示例#1
0
def get_trackInfos(path):
	"""docstring for get_trackInfos
		[
			{
			u'track': 
				{
				u'dj_set_id': 296, 
			 	u'short_link': 
			 	u'http://bit.ly/2kBCpb', 
			 	u'artist': 
					{
					u'large': u'http://userserve-ak.last.fm/serve/252/192768.jpg',
					u'name': u'Essential Mix',
					u'id': 1896
					},
				u'created_at': u'2009-01-12T22:34:59Z',
				u'trackEndTime': 152,
				u'updated_at': u'2009-08-26T08:05:14Z',
				u'trackTitle': u'Intro',
				u'plays_count': 108,
				u'likes': 0,
				u'buylink_stamp': u'2009-07-20T05:04:06Z',
				u'trackNumber': 1,
				u'trackStartTime': 0,
				u'artist_id': 1896,
				u'id': 4932
				}
			}
		]
	"""
	tracksJson = retrieve_url(BASE_URL + get_asset_path(path) +'.json')
	tracks = demjson.decode(tracksJson)
	return tracks
示例#2
0
def get_episode():
	"""docstring for get_episode
	{u'configuration': 
		{u'search': u'http://www.google.com/search?q=', 
		u'description': u'Toyota Prius, Aprilia Tuono 1000R, Honda Accord 2.2 I-DTEC', 
		u'title': u'Autu00f3mu00e1nia 09-10-24', 
		u'image': u'http://www.rtlklub.hu/most/files/thumbnails/005/217/1.jpg', 
		u'outro_skipable': False, 
		u'intro_skipable': False, 
		u'intro': '', 
		u'file': [u'http://92.52.253.141/most/005/217/automania091024.mp4'], 
		u'outro': '', 
		u'intro_url': '', 
		u'outro_url': '', 
		u'id': u'5217'
	}, 
	u'share': [{u'action': u'showEmbed', u'label': u'megosztu00e1s', u'icon': u'SHARE_LINK'}], u'related': [{u'url': u'http://www.rtlklub.hu/most/5049_automania_09-10-17', u'thumbnail': u'http://www.rtlklub.hu/most/files/thumbnails/005/049/1.jpg', u'name': u'Autu00f3mu00e1nia 09-10-17'}, {u'url': u'http://www.rtlklub.hu/most/4911_automania_09-10-10', u'thumbnail': u'http://www.rtlklub.hu/most/files/thumbnails/004/911/1.jpg', u'name': u'Autu00f3mu00e1nia 09-10-10'}, {u'url': u'http://www.rtlklub.hu/most/4735_automania_09-10-03', u'thumbnail': u'http://www.rtlklub.hu/most/files/thumbnails/004/735/1.jpg', u'name': u'Autu00f3mu00e1nia 09-10-03'}, {u'url': u'http://www.rtlklub.hu/most/4493_automania_09-09-26', u'thumbnail': u'http://www.rtlklub.hu/most/files/thumbnails/004/493/1.jpg', u'name': u'Autu00f3mu00e1nia 09-09-26'}, {u'url': u'http://www.rtlklub.hu/most/4357_automania_09-09-19', u'thumbnail': u'http://www.rtlklub.hu/most/files/thumbnails/004/357/1.jpg', u'name': u'Autu00f3mu00e1nia 09-09-19'}, {u'url': u'http://www.rtlklub.hu/most/4191_automania_09-09-12', u'thumbnail': u'http://www.rtlklub.hu/most/files/thumbnails/004/191/1.jpg', u'name': u'Autu00f3mu00e1nia 09-09-12'}, {u'url': u'http://www.rtlklub.hu/most/4059_automania_09-09-05', u'thumbnail': u'http://www.rtlklub.hu/most/files/thumbnails/004/059/1.jpg', u'name': u'Autu00f3mu00e1nia 09-09-05'}], u'checkpoints': [], u'login_configuration': {u'login_description': '', u'login': u'http://www.rtlklub.hu/most/player/content/login.php', u'login_title': u'Lu00e9pj be u00e9s nu00e9zd tovu00e1bb!', u'lostpass': u'showLostPassword', u'registration': u'showRegistration'}}
	
	
	"""
	html = retrieve_url("http://www.rtlklub.hu/most/5217_automania_09-10-24")

	episodeHash = find_episode_hash(html)
	html = retrieve_url("http://www.rtlklub.hu/most/player/content/parameters.php?hash="+episodeHash)

	# unescape the backslashes
	episode = demjson.decode(html)
	return episode["configuration"]
示例#3
0
 def get(self,fname):        
     #url = 'http://localhost:8080/static/data/%s.json' % fname
     url = 'http://btbytes.com/default.json'
     response = urlfetch.fetch(url).content
     json = demjson.decode(response)
     titles = [r['title'] for r in json]
     for r in json:
         entry = make_entry(r)
         entry.put()
     
     self.render('templates/shooin.html', fname=fname, titles=titles)
示例#4
0
 def get(self,fname):        
     #url = 'http://localhost:8080/static/data/%s.json' % fname
     url = 'http://btbytes.com/default.json'
     response = urlfetch.fetch(url).content
     json = demjson.decode(response)
     titles = [r['title'] for r in json]
     for r in json:
         entry = make_entry(r)
         entry.put()
     
     self.render('templates/shooin.html', fname=fname, titles=titles)