From 9aad538d73b91b728663f16b7e2efc79141cf4b6 Mon Sep 17 00:00:00 2001 From: Gregor Leban Date: Mon, 14 Dec 2020 08:53:13 +0100 Subject: [PATCH] Update README.md --- README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 04ba9af..c6f79cb 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,18 @@ When making queries to Event Registry you will have to use an API key that you c ## Three simple examples to make you interested +**Find news articles that mention Tesla in the article title** + +```python +from eventregistry import * +er = EventRegistry(apiKey = YOUR_API_KEY) +# print at most 500 articles +MAX_ITEMS = 500 +q = QueryArticlesIter(keywords = "tesla", keywordsLoc="title") +for art in q.execQuery(er, sortBy = "date", maxItems = MAX_ITEMS): + print(art) +``` + **Print a list of recently added articles mentioning George Clooney** ```python @@ -58,15 +70,11 @@ q.setRequestedResult(RequestEventsInfo(sortBy = "date", count=10)) # return ev print er.execQuery(q) ``` -**What are the currently trending topics** +## Run a Jupyter notebook -```python -from eventregistry import * -er = EventRegistry(apiKey = YOUR_API_KEY) -# top 10 trending concepts in the news -q = GetTrendingConcepts(source = "news", count = 10) -print er.execQuery(q) -``` +We've also prepared an interactive Jupyter notebook where we demonstrate how you can use the SDK. You can run it online and modify the individual examples. + +**[Run Jupyter notebook with examples](https://mybinder.org/v2/gh/EventRegistry/event-registry-python-intro/master) ## Where to next?