academictwitteR | academictwitteR package to query the Twitter Academic | REST library
kandi X-RAY | academictwitteR Summary
kandi X-RAY | academictwitteR Summary
Repo containing code to for R package academictwitteR to collect tweets from v2 API endpoint for the Academic Research Product Track.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of academictwitteR
academictwitteR Key Features
academictwitteR Examples and Code Snippets
Community Discussions
Trending Discussions on academictwitteR
QUESTION
I pulled tweets from twitter using the academictwitter
package. I would now like to remove all retweets = tweets starting with "RT" in the first column "text" (e.g. third row). You can download a similar data frame from github including tweets from Trump: https://github.com/cbail/cbail.github.io/blob/master/Trump_Tweets.Rdata
Except my data frame has no column called "is_retweet", which makes it more difficult.
The output from my data frame looks like this (I have removed some redundant columns to make it clearer):
Thank you in advance for any suggestions
...ANSWER
Answered 2022-Feb-04 at 17:32You can use regular expressions to figure out which rows start with 'RT'. If your data is in a data frame called tweets
, maybe something like this?
QUESTION
With little experience in API programming, I am looking for a way to send a DELETE or POST request using the Twitter API v2.0 with the httr package in R. I usually use the academictwitteR package to interact with the API, but the package uses a bearer token authentication that seems to me to not be adequate for write privileges (required by DELETE and POST). Therefore, it seemed that the first step is setting up the OAuth 1.0a authentication credintials as described here. I downloaded and stored the four variables (oauth_token
; oauth_token_secret
; oauth_consumer_key
; oauth_consumer_secret
) from the app I created, but then I am stuck as to how to set up the request with httr
.
I can't provide an example since I could not figure out the code, I hope you understand. Any help is much appreciated!
...ANSWER
Answered 2021-Oct-10 at 19:57I looked at the curl examples for DELETE and POST requests you provided. They are rewrotten in R below. You need to replace the $OAUTH_SIGNATURE
though. Please let me know if it works for you as I cannot check the code as I do not have a Twitter account nor do I have the OAuth token.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install academictwitteR
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page