{"id":13400634,"url":"https://github.com/statnmap/tweetrbot","last_synced_at":"2025-09-21T02:02:55.860Z","repository":{"id":117563399,"uuid":"205444740","full_name":"statnmap/tweetrbot","owner":"statnmap","description":"Functions for a Twitter bot","archived":false,"fork":false,"pushed_at":"2022-10-16T12:40:03.000Z","size":1373,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T19:24:55.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://statnmap.github.io/tweetrbot/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/statnmap.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-30T19:28:03.000Z","updated_at":"2023-02-26T13:32:55.000Z","dependencies_parsed_at":"2024-01-18T11:03:45.328Z","dependency_job_id":"5c79a906-d540-4ac0-9afa-cbf57c7afc57","html_url":"https://github.com/statnmap/tweetrbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/statnmap/tweetrbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statnmap%2Ftweetrbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statnmap%2Ftweetrbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statnmap%2Ftweetrbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statnmap%2Ftweetrbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statnmap","download_url":"https://codeload.github.com/statnmap/tweetrbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statnmap%2Ftweetrbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264613345,"owners_count":23637339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:00:54.116Z","updated_at":"2025-09-21T02:02:50.811Z","avatar_url":"https://github.com/statnmap.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n# Copy reference/images to man/images\n# reference folder is required to work with pkgdown\nif (!dir.exists(\"man/figures\")) {dir.create(\"man/figures\")}\nfile.copy(list.files(\"reference/figures\", full.names = TRUE),\n          \"man/figures\", overwrite = TRUE)\n```\n# tweetrbot\n\n\u003c!-- badges: start --\u003e\n[![R build status](https://github.com/statnmap/tweetrbot/workflows/R-CMD-check/badge.svg)](https://github.com/statnmap/tweetrbot/actions)\n\u003c!-- badges: end --\u003e\n\n\u003c!-- description: start --\u003e\nThis is package {tweetrbot}: Functions for a Twitter bot.  \nCurrent version is 0.0.1\n\u003c!-- description: end --\u003e\n\n## Installation\n\u003c!-- install: start --\u003e\nThe list of dependencies required to install this package is: {dplyr}, {knitr}, {magrittr}, {rmarkdown}, {rtweet}.\n\nTo install the package, you can run the following script\n\n```{r, echo=TRUE, eval=FALSE}\n# install.packages(\"remotes\")\nremotes::install_github(repo = \"statnmap/tweetrbot\")\n```\n\n## Example\n\n```{r, echo=FALSE, out.width=\"60%\", fig.align='center'}\nknitr::include_graphics(path = \"reference/figures/fig_tweetrbot_with_func.png\")\n```\n  \n  \n```{r}\nlibrary(tweetrbot)\n```\n\nThis package is presented in a blog post on \u003chttps://statnmap.com/2019-08-30-create-a-twitter-bot-on-a-raspberry-pi-3-using-r\u003e  \n\n### Run the scripts to retweet a specific hashtag\n\nThis is set for a bot. This means that every tweets retrieved from `get_and_store()` will be retweeted using `retweet_and_update()` using a loop, with 1 tweet every 600 seconds here. Set to `debug=TRUE` to avoid really tweeting on Twitter if you want to make some tests.  \n\n```{r example, eval=FALSE}\n## Retrieve tweets, store on the drive\nget_and_store(query = \"#rspatial\", n_tweets = 20, dir = \".\")\n## Tweet regularly and update the table stored on the drive\nretweet_and_update(dir = \".\", n_tweets = 20, n_limit = 3, sys_sleep = 600, debug = TRUE)\n```\n```{r, echo=FALSE}\nrds_file \u003c- system.file(\"complete_tweets_rspatial.rds\", package = \"tweetrbot\")\nall_tweets \u003c- readRDS(rds_file)\nall_tweets\n```\n\n### Run the script to retrieve your user information\n```{r, eval=FALSE}\nget_account_info(user = \"talk_rspatial\")\n```\n\n### Post the most retweeted tweet of the month\n\nGet the database gathered with `get_and_store()` and tweet the top of the month using `top_tweets()`.  \n\n```{r, eval=FALSE}\nrds_file \u003c- system.file(\"complete_tweets_rspatial.rds\", package = \"tweetrbot\")\nall_tweets \u003c- readRDS(rds_file)\n# filter on last month\nlast_month_tweets \u003c- all_tweets %\u003e% filter_month(the_month = 4, the_year = 2020)\n# update last month\nlast_month_updated \u003c- update_data(\n  path = rds_file, \n  statuses = last_month_tweets$status_id)\n# Get stats of last month tweets\ntop_tweets(all_tweets = last_month_updated, post_tweet = TRUE, top_number = 5)\n```\n```{r, echo=FALSE, out.width=\"45%\"}\noutput \u003c- all_tweets %\u003e% \n  filter_month(the_month = 4, the_year = 2020) %\u003e% \n  top_tweets(post_tweet = FALSE, top_number = 5)\noutput$number_tweets\noutput$number_contributors\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatnmap%2Ftweetrbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatnmap%2Ftweetrbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatnmap%2Ftweetrbot/lists"}