在Python3.5中使用 The del.icio.us API

问题:参考《集体智慧编程》一书的第二章中访问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': ''}]

原文地址:https://www.cnblogs.com/winterfells/p/6215120.html