From 3e56e15a2b8ae008cc6b75f479099bcb635f346c Mon Sep 17 00:00:00 2001 From: Pietro Monticone <38562595+pitmonticone@users.noreply.github.com> Date: Fri, 1 Jul 2022 07:50:40 +0200 Subject: [PATCH 1/2] Clean modules and labs-code Fixed a few typos. --- labs-code/python/academic-research-product-track/compliance.py | 2 +- labs-code/python/standard-product-track/compliance.py | 2 +- modules/2-choosing-the-right-product-track.md | 2 +- modules/3-deciding-which-endpoints-to-use.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/labs-code/python/academic-research-product-track/compliance.py b/labs-code/python/academic-research-product-track/compliance.py index e7a8857..ebef6ee 100644 --- a/labs-code/python/academic-research-product-track/compliance.py +++ b/labs-code/python/academic-research-product-track/compliance.py @@ -18,7 +18,7 @@ def main(): result = expansions.flatten(page) for tweet in result: compliant_tweet_ids.append(tweet['id']) - # Here we get a difference betweetn the original + # Here we get a difference between the original non_compliant_tweet_ids = list(set(all_tweet_ids) - set(compliant_tweet_ids)) # Here we are printing the list of Tweet IDs that are not compliant in your dataset print(non_compliant_tweet_ids) diff --git a/labs-code/python/standard-product-track/compliance.py b/labs-code/python/standard-product-track/compliance.py index e7a8857..ebef6ee 100644 --- a/labs-code/python/standard-product-track/compliance.py +++ b/labs-code/python/standard-product-track/compliance.py @@ -18,7 +18,7 @@ def main(): result = expansions.flatten(page) for tweet in result: compliant_tweet_ids.append(tweet['id']) - # Here we get a difference betweetn the original + # Here we get a difference between the original non_compliant_tweet_ids = list(set(all_tweet_ids) - set(compliant_tweet_ids)) # Here we are printing the list of Tweet IDs that are not compliant in your dataset print(non_compliant_tweet_ids) diff --git a/modules/2-choosing-the-right-product-track.md b/modules/2-choosing-the-right-product-track.md index 168af5a..36d4112 100644 --- a/modules/2-choosing-the-right-product-track.md +++ b/modules/2-choosing-the-right-product-track.md @@ -18,7 +18,7 @@ It is ideal for undergraduate or high school students who want to use Twitter da These are just some examples of what you can get from the standard product track, relevant to academics. For a complete list of available endpoints, check out the [Twitter API documentation](https://developer.twitter.com/en/docs/twitter-api). -Currently, you can get upto 500,000 Tweets per month using the standard product track and this limit does not apply to the sampled stream endpoint, which gives a 1% sample of public Tweets in real-time +Currently, you can get up to 500,000 Tweets per month using the standard product track and this limit does not apply to the sampled stream endpoint, which gives a 1% sample of public Tweets in real-time ## Academic Research product track diff --git a/modules/3-deciding-which-endpoints-to-use.md b/modules/3-deciding-which-endpoints-to-use.md index e33cb2c..34e1ae8 100644 --- a/modules/3-deciding-which-endpoints-to-use.md +++ b/modules/3-deciding-which-endpoints-to-use.md @@ -10,7 +10,7 @@ Let us look at some use cases below, to learn which endpoints can best support t In order to get Tweets from the last 7 days, you can use the recent search endpoint and specify the keywords you want to search for. Additionally, you can use operators that let you narrow down your search (more on how to use these operators and build queries in module 5). This endpoint is available on the standard product track, so even if you don’t have access to the academic research product track, you can still get this data from the last 7 days. If you have access to the academic research product track, then you get additional operators as well as longer query length to use with this recent search endpoint. -*Fun fact:* By default, this endpoint returns 10 Tweets per request, and upto 100 Tweets per request using a max_results parameter. Thus, if you want 1000 Tweets, you will have to make 10 requests with max_results set to 100. However, many libraries and packages, including the ones we will be using for code samples in module 6, take care of making the API calls to the endpoints for you (behind the scenes) and get you the Tweets you need. Libraries and packages make it easy for you to get data from the Twitter API using functions. This reduces the amount of code you need to write in order to connect to the API and to get the API response and parse it. +*Fun fact:* By default, this endpoint returns 10 Tweets per request, and up to 100 Tweets per request using a max_results parameter. Thus, if you want 1000 Tweets, you will have to make 10 requests with max_results set to 100. However, many libraries and packages, including the ones we will be using for code samples in module 6, take care of making the API calls to the endpoints for you (behind the scenes) and get you the Tweets you need. Libraries and packages make it easy for you to get data from the Twitter API using functions. This reduces the amount of code you need to write in order to connect to the API and to get the API response and parse it. [Learn how to get started with the recent search endpoint](https://developer.twitter.com/en/docs/twitter-api/tweets/search/introduction) From 0f44a0b7643523b8a858a30b2151bd39ec712ccb Mon Sep 17 00:00:00 2001 From: Pietro Monticone <38562595+pitmonticone@users.noreply.github.com> Date: Tue, 14 Mar 2023 13:57:21 +0100 Subject: [PATCH 2/2] Fix typos --- modules/6a-labs-code-academic-python.md | 2 +- modules/6b-labs-code-standard-python.md | 2 +- modules/7-storage-and-compliance.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/6a-labs-code-academic-python.md b/modules/6a-labs-code-academic-python.md index f14936a..26cf003 100644 --- a/modules/6a-labs-code-academic-python.md +++ b/modules/6a-labs-code-academic-python.md @@ -503,7 +503,7 @@ def main(): result = expansions.flatten(page) for tweet in result: compliant_tweet_ids.append(tweet['id']) - # Here we get a difference betweetn the original + # Here we get a difference between the original non_compliant_tweet_ids = list(set(all_tweet_ids) - set(compliant_tweet_ids)) # Here we are printing the list of Tweet IDs that are not compliant in your dataset print(non_compliant_tweet_ids) diff --git a/modules/6b-labs-code-standard-python.md b/modules/6b-labs-code-standard-python.md index 3c2d3ed..e19b461 100644 --- a/modules/6b-labs-code-standard-python.md +++ b/modules/6b-labs-code-standard-python.md @@ -508,7 +508,7 @@ def main(): result = expansions.flatten(page) for tweet in result: compliant_tweet_ids.append(tweet['id']) - # Here we get a difference betweetn the original + # Here we get a difference between the original non_compliant_tweet_ids = list(set(all_tweet_ids) - set(compliant_tweet_ids)) # Here we are printing the list of Tweet IDs that are not compliant in your dataset print(non_compliant_tweet_ids) diff --git a/modules/7-storage-and-compliance.md b/modules/7-storage-and-compliance.md index dc9af41..fc970dd 100644 --- a/modules/7-storage-and-compliance.md +++ b/modules/7-storage-and-compliance.md @@ -32,7 +32,7 @@ If you want to process data from the filtered stream endpoint and store the Twee When you are using the Twitter API, you should ensure that you are complying with the [Twitter developer policy](https://developer.twitter.com/en/developer-terms/policy). If you store Twitter data offline, you must keep it up to date with the current state of that content on Twitter. Specifically, you must delete or modify any content in your dataset if it is deleted or modified on Twitter. -One way academics can do this is by periodically calling the [Tweet lookup endpoint](https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/introduction), with a list of Tweet IDs (upto 100 per request) from their datasets. If a Tweet has been deleted or was posted from a now- suspended or private account, the API response will indicate that and you should delete that Tweet (JSON) from your dataset. An example of this is shown in the labs in module 6 above. +One way academics can do this is by periodically calling the [Tweet lookup endpoint](https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/introduction), with a list of Tweet IDs (up to 100 per request) from their datasets. If a Tweet has been deleted or was posted from a now- suspended or private account, the API response will indicate that and you should delete that Tweet (JSON) from your dataset. An example of this is shown in the labs in module 6 above. ## Sharing Tweet IDs for peer-review