Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fortune Cookie dummy API(p220) #6

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dummy_api/fortune_cookie_random1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You will be surprised by a loud noise.\r\n\n[codehappy] http://iheartquotes.com/fortune/show/20447
3 changes: 3 additions & 0 deletions dummy_api/fortune_cookie_random2.txt
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions dummy_api/youTube_top_rated.json
Original file line number Diff line number Diff line change
@@ -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"}}
]
}
}
2 changes: 1 addition & 1 deletion intro/youtube.py
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
2 changes: 1 addition & 1 deletion intro/youtube2.py
Original file line number Diff line number Diff line change
@@ -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]:
Expand Down