diff --git a/dummy_api/fortune_cookie_random1.txt b/dummy_api/fortune_cookie_random1.txt new file mode 100644 index 0000000..eea0cb5 --- /dev/null +++ b/dummy_api/fortune_cookie_random1.txt @@ -0,0 +1 @@ +You will be surprised by a loud noise.\r\n\n[codehappy] http://iheartquotes.com/fortune/show/20447 diff --git a/dummy_api/fortune_cookie_random2.txt b/dummy_api/fortune_cookie_random2.txt new file mode 100644 index 0000000..05fa5e9 --- /dev/null +++ b/dummy_api/fortune_cookie_random2.txt @@ -0,0 +1,3 @@ +I know that there are people who do not love their fellow man, and I people like that! + -- Tom Lehrer, Satirist and Professor + [codehappy] http://iheartquotes.com/fortune/show/21465 diff --git a/dummy_api/youTube_top_rated.json b/dummy_api/youTube_top_rated.json new file mode 100644 index 0000000..3991bd7 --- /dev/null +++ b/dummy_api/youTube_top_rated.json @@ -0,0 +1,12 @@ +{ + "feed": { + "entry": [ + {"title": {"$t": "Evolution of Dance - By Judson Laipply"}}, + {"title": {"$t": "Linkin Park - Numb"}}, + {"title": {"$t": "Potter Puppet Pals: The Mysterious Ticking Noise"}}, + {"title": {"$t": "\"Chocolate Rain Original\" Song by Tay Zonday"}}, + {"title": {"$t": "Charlie bit my finger - again !"}}, + {"title": {"$t": "The Mean Kitty Song"}} + ] + } +} diff --git a/intro/youtube.py b/intro/youtube.py index 278d9c9..db3cffb 100644 --- a/intro/youtube.py +++ b/intro/youtube.py @@ -1,6 +1,6 @@ import json from urllib.request import urlopen -url = "https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?alt=json" +url = "https://raw.githubusercontent.com/koki0702/introducing-python/master/dummy_api/youTube_top_rated.json" response = urlopen(url) contents = response.read() text = contents.decode('utf8') diff --git a/intro/youtube2.py b/intro/youtube2.py index e5d5b1c..2812696 100644 --- a/intro/youtube2.py +++ b/intro/youtube2.py @@ -1,5 +1,5 @@ import requests -url = "https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?alt=json" +url = "https://raw.githubusercontent.com/koki0702/introducing-python/master/dummy_api/youTube_top_rated.json" response = requests.get(url) data = response.json() for video in data['feed']['entry'][0:6]: