f
Version 1

No description specified

SEEK ID: https://testing.sysmo-db.org/data_files/210?version=1

Filename: Search.py  Download

Format: Plain text document

Size: 684 Bytes

# coding: utf-8

# In[21]:


import requests
import json
import string
base_url = 'http://www.fairdomhub.org/'


# In[22]:


headers = {"Content-type": "application/vnd.api+json",
           "Accept": "application/vnd.api+json"}


# In[23]:


term = input("Enter the search term: ")


# In[24]:


print (term)


# In[25]:


url = "{0}search?q={1}".format(base_url, term)


# In[26]:


print (url)


# In[27]:


r = requests.get(url, headers=headers)


# In[28]:


print (r.text)


# In[29]:


json_r = json.loads(r.text)


# In[30]:


print (json_r)


# In[31]:


for entry in json_r['data']:
    print ("Type: {0}   Title: {1}".format(entry['type'], entry['attributes']['title']))

help Creators and Submitter
Creators
Not specified
Submitter
Activity

Views: 2137   Downloads: 75

Created: 20th May 2018 at 19:41

help Tags

This item has not yet been tagged.

help Attributions

None

Version History

Version 1 (earliest) Created 20th May 2018 at 19:41 by Alan Williams

No revision comments

Powered by
(v.1.18.0)