-
Notifications
You must be signed in to change notification settings - Fork 54
Number of mentions in news or social media
Sometimes it might be valuable to know how often is a particular concept mentioned in the news or social media on a particular date. How often was, for example Barack Obama mentioned in the news in March 2015? Or, how often were articles about Ebola virus shared in social media in August 2014?
To obtain this type of information we can use the GetCounts()
class. For computing popularity of Barack Obama in the news, we can use the following code:
from eventregistry import *
er = EventRegistry(apiKey = YOUR_API_KEY)
q = GetCounts(er.getConceptUri("Obama"),
source = "news",
startDate = "2015-03-01", endDate = "2015-03-31")
ret = er.execQuery(q)
The returned result would be something like:
{
"http://en.wikipedia.org/wiki/Barack_Obama": [
{
"count": 1123,
"date": "2015-03-01"
},
{
"count": 1695,
"date": "2015-03-02"
},
// remaining values
]
}
The parameters that are accepted by the GetCounts()
class are:
-
uriOrUriList
: concept/category uri or a list of uris -
source
: input source information from which to compute top trends. Options:news
,social
-
type
: what do the provided uris represent -concept
orcategory
-
startDate
: starting date from which to provide counts onward (eitherNone
,datetime.date
or "YYYY-MM-DD") -
endDate
: ending date until which to provide counts (eitherNone
,datetime.date
or "YYYY-MM-DD") -
returnInfo
: specify the details of the concepts/categories to return
Core Information
Usage tracking
Terminology
EventRegistry
class
ReturnInfo
class
Data models for returned information
Finding concepts for keywords
Filtering content by news sources
Text analytics
Semantic annotation, categorization, sentiment
Searching
Searching for events
Searching for articles
Article/event info
Get event information
Get article information
Other
Supported languages
Different ways to search using keywords
Feed of new articles/events
Social media shares
Daily trends
Find the event for your own text
Article URL to URI mapping