Skip to content

mazi76erX2/mention-python

Repository files navigation

Mention-Python

image

image

image

image

A Python wrapper around the Mention API.

Installation

$ python3 -m pip install mention
>>> from mention import FetchAMentionAPI
>>> first_mention = FetchAMentionAPI('access_token', 'account_id', 'alert_id', 'mention_id')

>>> first_mention_data = first_mention.query()

>>> title = first_mention_data['title']

Examples

Fetch all alerts of an account

>>> import mention

>>> 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']

Fetch a mention

>>> 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 
... of their own home."

>>> data['original_url']                            
'https://www.iol.co.za/business-report/technology/nandos-launches-their-own-food-
... ordering-app-18378360'

Read More

About

A Python client library for Mention's API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages