{"id":20388825,"url":"https://github.com/mkearney/jeopboty","last_synced_at":"2026-03-06T13:03:05.624Z","repository":{"id":124078540,"uuid":"88092679","full_name":"mkearney/jeopboty","owner":"mkearney","description":"My Jeopardy Twitter bot","archived":false,"fork":false,"pushed_at":"2017-04-17T15:54:50.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T10:55:43.875Z","etag":null,"topics":["jeopardy","rtweet","twitter-bot","twitter-streaming-api","webscraper"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkearney.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-12T20:18:23.000Z","updated_at":"2019-02-20T23:16:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a061c55-df2f-4412-8542-ac6151713cca","html_url":"https://github.com/mkearney/jeopboty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mkearney/jeopboty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Fjeopboty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Fjeopboty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Fjeopboty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Fjeopboty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkearney","download_url":"https://codeload.github.com/mkearney/jeopboty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Fjeopboty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30178286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T12:39:21.703Z","status":"ssl_error","status_checked_at":"2026-03-06T12:36:09.819Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["jeopardy","rtweet","twitter-bot","twitter-streaming-api","webscraper"],"created_at":"2024-11-15T03:13:30.073Z","updated_at":"2026-03-06T13:03:05.616Z","avatar_url":"https://github.com/mkearney.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\\#jeopboty: a jeopardy twitter bot\n==================================\n\nI [scraped Jeopardy clues and answers from an online archive](R/scrape-jeopardy.r) and created a bot-like script to post them to Twitter.\n\nThe [bot script](R/jeopboty.r) can be found in the R folder. It's also pasted below.\n\n``` r\n\n## save current directory\nod \u003c- getwd()\n\n## for now, go to R dir in jeopboty\nsetwd(\"~/r/jeopboty/R\")\n\n## Reading data and the [correct] Twitter token\n## load rtweet\nlibrary(rtweet)\n\n## If you haven't created and saved a personal access Twitter API\n## token, do it now following these instructions (uncomment next line):\n## vignette(\"auth\", \"rtweet\")\n\n## Make sure you've given the token \"write\" access (permission)\n## which you can check through your Twitter account.\n## Uncomment next line to open browser to Twitter's app page.\n## browseURL(\"https://apps.twitter.com\")\n\n## If you already saved your token as an environment variable, you can\n## fetch it using the get_tokens() function.\ntoken \u003c- get_tokens()\n\n## I have a token I use exclusively for my #jeopboty statuses,\n## so I've saved that in my data folder (note: token won't\n## appear in my Github repository; nice try!)\ntoken \u003c- readRDS(\"../data/rtw.rds\")\n\n## Get the screen name associated with your token.\nmy_screen_name \u003c- token$credentials$screen_name\n\n## This should print out YOUR screen name:\nmy_screen_name\n\n## Read jeopardy data.\njeop \u003c- readRDS(\"../data/jeopardy.rds\")\n\n## Posting the CLUE status on Twitter\n## Randomly select a question.\ni \u003c- sample(seq_len(NROW(jeop)), 1L)\n\n## Compose CLUE status.\nclue \u003c- paste0(\"Clue: \", jeop$clue[i], \" #jeopboty\")\n\n## Post CLUE status to Twitter.\npost_tweet(clue, token = token)\n\n## Keeping track of questions you've tweeted over time\n## Either extract and update or create \"used\" data object.\nif (\"used\" %in% names(attributes(jeop))) {\n    ## Extract used data attribute\n    used \u003c- attr(jeop, \"used\")\n\n    ## Determine clue [number] n post.\n    n \u003c- NROW(used[[\"id\"]]) + 1L\n\n    ## Update (append) used object\n    used[[\"id\"]][n] \u003c- n\n    used[[\"datetime\"]][n] \u003c- Sys.time()\n    used[[\"clue\"]][n] \u003c- jeop$clue[i]\n    used[[\"answer\"]][n] \u003c- jeop$answer[i]\n\n} else {\n    ## Create used object.\n    used \u003c- list(\n        id = 1,\n        datetime = Sys.time(),\n        clue = jeop$clue[i],\n        answer = jeop$answer[i])\n}\n\n## Add \"used\" data attribute to \"jeop\" data.\nattr(jeop, \"used\") \u003c- used\n\n## Save data (dropping the row that was just posted.\nsaveRDS(jeop[-i, ], \"../data/jeopardy.rds\")\n\n## Posting the ANSWER status on Twitter\n## Get recent timeline data for your account.\ntw \u003c- get_timeline(my_screen_name)\n\n## Find and return status ID of most recent clue.\nstatus_id \u003c- tw$status_id[grep(\"^Clue\", tw$text)[1]]\n\n## Use the status ID to create quote link.\nquote \u003c- paste0(\"https://twitter.com/\",\n                my_screen_name,\n                \"/status/\",\n                status_id)\n\n## Compose ANSWER status.\nanswer \u003c- paste0(\n    \"Answer: \", jeop$answer[i], \" #jeopboty \", quote)\n\n## Post ANSWER status to Twitter.\npost_tweet(answer, token = token)\n\n## on exit return wd\nsetwd(od)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkearney%2Fjeopboty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkearney%2Fjeopboty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkearney%2Fjeopboty/lists"}