fork(2) download
  1. import requests
  2. import xml.etree.ElementTree as ET
  3. import sys
  4. LANGUAGE = 'zh-TW'
  5. REGION = 'TW'
  6. TIME = 'today'
  7. response = requests.get('http://g...content-available-to-author-only...e.com/schemas/2007/categories.cat?hl='+LANGUAGE)
  8. categoryRoot = ET.fromstring(response.text)
  9. atom = '{http://w...content-available-to-author-only...3.org/2005/Atom}'
  10. yt = '{http://g...content-available-to-author-only...e.com/schemas/2007}'
  11. file = open('output','w')
  12. for entry in categoryRoot.findall(atom + 'category'):
  13. if entry.find(yt + 'assignable') is not None:
  14. response = requests.get('https://g...content-available-to-author-only...e.com/feeds/api/standardfeeds/TW/most_popular_'+entry.get('term')+'?time='+TIME+'&v=2&alt=json')
  15. #file.write(response.text)
  16. print (response.text.encode('cp950'))
Runtime error #stdin #stdout #stderr 0.14s 10304KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 1, in <module>
    import requests
ImportError: No module named requests