No description specified
# 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']))
Creators and SubmitterCreators
Not specifiedSubmitter
Activity
Views: 2137 Downloads: 75
Created: 20th May 2018 at 19:41
TagsThis item has not yet been tagged.
AttributionsNone
Version History
Version 1 (earliest) Created 20th May 2018 at 19:41 by Alan Williams
No revision comments
Download
View content