SHARE
TWEET

example

furas Aug 4th, 2018 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import requests
  2. import datetime
  3.  
  4. def get(url, name='?'):
  5.    
  6.     print('---', name, '---')
  7.    
  8.     r = requests.get(url)
  9.      
  10.     data = r.json()
  11.     #print(data.keys())
  12.     #print(data['headDocument'].keys())
  13.     #print(data['featured'].keys())
  14.     #print(data['featured']['content'][0])
  15.     #print(data['networkSettings'].keys())
  16.     #print(data['siteSettings'].keys())
  17.     #print(data['collectionSettings'].keys())
  18.  
  19.    
  20.     if 'headDocument' in data:
  21.         data = data['headDocument']['content']
  22.     else:
  23.         data = data['content'][::-1]
  24.  
  25.     for item in data:
  26.         dt = datetime.datetime.fromtimestamp(item['content']['createdAt'])
  27.         time = dt.strftime('%Y.%m.%d %H:%M')
  28.         title = item['content']['bodyHtml']
  29.         title = title.split('</strong>')[0].split('<strong>')[1]
  30.         print(time, title)
  31.  
  32. #requests.get('http://www.skysports.com/football/france-vs-croatia/live/385232')
  33. get('https://data.livefyre.com/bs3/v3.1/bskyb.fyre.co/363166/MTE0MDIxNTE=/init', 'init')
  34. for x in range(45, 39, -1):
  35.     get('https://data.livefyre.com/bs3/v3.1/bskyb.fyre.co/363166/MTE0MDIxNTE=/{}.json'.format(x), x)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top