標籤:with python安裝 end 項目 http pop int 使用 span
問題:參考《集體智慧編程》一書的第二章中訪問del.icio.us網站的資料需要使用到事先編好的Python API。但是書上提供的API並不適用與Python3.5的版本。
解決方案:在Google搜尋pydelicious for python3.5,第一個github項目,把他所提供的pydelicious.py下載下來,添加到python安裝目錄的lib中即可
出現的情況:登入這個github項目需要FQ,如果不FQ可以用網頁快照式複寫下;在使用的pydelicious的時候先要pip feedparser
測試:print(pydelicious.get_popular(tag=‘programming‘))
輸出:[{‘hash‘: ‘‘, ‘user‘: ‘delicious‘, ‘description‘: ‘Sponsored: 64% off Code Black Drone with HD Camera‘, ‘dt‘: ‘‘, ‘href‘: ‘https://shop.icio.us/sales/the-limited-edition-black-hawk-drone-hd-camera?utm_source=del.icio.us&utm_medium=referral&utm_campaign=the-limited-edition-black-hawk-drone-hd-camera‘, ‘extended‘: ‘Our #1 Best-Selling Drone--Meet the Dark Night of the Sky!‘, ‘tags‘: ‘‘, ‘count‘: ‘‘}, {‘hash‘: ‘‘, ‘user‘: ‘‘, ‘description‘: ‘something went wrong‘, ‘dt‘: ‘‘, ‘href‘: ‘‘, ‘extended‘: ‘‘, ‘tags‘: ‘‘, ‘count‘: ‘‘}]
在Python3.5中使用 The del.icio.us API