提到api的python包装器。
mention的Python项目详细描述
api周围的python包装器。
安装
$ python3 -m pip install mention
>>>frommentionimportFetchAMentionAPI>>>first_mention=FetchAMentionAPI('access_token','account_id','alert_id','mention_id')>>>first_mention_data=first_mention.query()>>>title=first_mention_data['title']
示例
获取帐户的所有警报
>>>allAlerts=mention.FetchAlertsAPI(access_token,account_id)>>>data=nandosAlert.query()>>>alertsList=data['alerts']>>>alertsList[5]['alert']['name']'Nandos'>>>data['alert']['query']['included_keywords']['Nandos','Flame-grilled Chicken','Peri-Peri Sauce']
获取一个提示
>>>nandosMention=mention.FetchAMentionAPI(access_token,account_id,alert_id,mention_id)>>>data=nandosMention.query()>>>data['title']"Nando's launches their own food ordering app">>>data['description']"Nando's has launched their own app that will allow people to order their favourite meal from the comfort...oftheirownhome.">>>data['original_url']'https:\/\/www.iol.co.za\/business-report\/technology\/nandos-launches-their-own-food-...ordering-app-18378360'
阅读更多信息