-
Notifications
You must be signed in to change notification settings - Fork 3
Social shares
In Event Registry we also store information how much individual articles are being shared on social networks, such as Facebook and LinkedIn, Google Plus and others. When requesting article information, you can set the socialScore = True
flag in ArticleInfoFlags
and the resulting articles will contain information about the number of shares of the article.
An example where articles about Apple with the most shares on social media would be:
import { EventRegistry, QueryArticles, RequestArticlesInfo, ReturnInfo, ArticleInfoFlags } from "eventregistry";
const er = new EventRegistry({apiKey: "YOUR_API_KEY"});
er.getConceptUri("Apple").then((appleUri) => {
const q = new QueryArticles({conceptUri: appleUri});
q.addRequestedResult(new RequestArticlesInfo({
count: 5,
sortBy: "socialScore",
returnInfo: new ReturnInfo({articleInfo: new ArticleInfoFlags({socialScore: true})}),
}));
const ret = er.execQuery(q);
});
The results from the promise are partially shown below. The shares on Facebook and Twitter are shown in the socialScore
object.
{
"articles": {
"results": [
{
"uri": "244825036",
"title": "Introducing the Leap Motion - YouTube",
"socialScore": {
"facebook": 72432,
"twitter": 1187
},
// remaining article properties (see Article data model)
},
{
"uri": "261446268",
"title": "Will the Second Generation Apple Watch Have This Amazing New Feature?",
"socialScore": {
"facebook": 4,
"twitter": 44576
},
// ...
}
],
...
}
}
Based on the shares of the articles in social media we also compute a social score for events. A social score of an event is computed by selecting all articles assigned to the event and sorting them by decreasing social score. Maximum top 30 articles are then selected and an average social score of them is computed and used as the event's social score.
A similar example as above is illustrated below. Now we search for events about Apple and request to get also the socialScore
property.
import { EventRegistry, QueryEvents, RequestEventsInfo, ReturnInfo, EventInfoFlags } from "eventregistry";
const er = new EventRegistry({apiKey: "YOUR_API_KEY"});
er.getConceptUri("Apple").then((appleUri) => {
const q = new QueryEvents({conceptUri: appleUri});
q.addRequestedResult(new RequestEventsInfo({
count: 5,
sortBy: "socialScore",
returnInfo: new ReturnInfo({articleInfo: new EventInfoFlags({socialScore: true})}),
}));
const ret = er.execQuery(q);
});
Part of the result of the query can be seen below. The social score of the event is stored in the socialScore
property.
{
"events": {
"resultCount": 58484,
"results": [
{
"uri": "2381731",
"title": {
"eng": "New Indiana 'Religious Liberty' Law Could Legalize Discrimination Against Gay People, Opponents Say"
},
"socialScore": 1835.824,
},
// remaining event properties (see Event data model)
]
}
}
Since we store information about the social scores of the articles, we are also able to provide the user with a list of top shared articles on any given day. This functionality is provided by the GetTopSharedArticles()
class. An example of the use would be:
import { EventRegistry, GetTopSharedArticles } from "eventregistry";
const er = new EventRegistry({apiKey: "YOUR_API_KEY"});
const q = new GetTopSharedArticles({date: "2015-05-23", count: 30});
const ret = er.execQuery(q);
Result from the promise would in this case contain a list of 30 articles that have the highest social score.
As for the articles, we can provide the same functionality also for events. For any given date, the user can obtain the list of events that have the highest socialScore
value. This list will therefore contain events for which the articles were shared the most. The class that provides this functionality is called GetTopSharedEvents
and can be used as follows:
import { EventRegistry, GetTopSharedEvents } from "eventregistry";
const er = new EventRegistry({apiKey: "YOUR_API_KEY"});
const q = new GetTopSharedEvents({date: "2015-05-23", count: 30});
const ret = er.execQuery(q);
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
Feed of new articles/events
Social media shares
Daily trends
Correlations
Mentions in news or social media
Find event for your own text
Article URL to URI mapping