Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kavun/random-spreadsheet-tweet-bot
tweet random cells from a Google spreadsheet
https://github.com/kavun/random-spreadsheet-tweet-bot
google-sheets google-spreadsheet google-spreadsheets now random tabletop twit twitter twitter-bot zeit
Last synced: 30 days ago
JSON representation
tweet random cells from a Google spreadsheet
- Host: GitHub
- URL: https://github.com/kavun/random-spreadsheet-tweet-bot
- Owner: kavun
- License: mit
- Created: 2019-02-21T03:31:34.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-18T18:38:10.000Z (almost 6 years ago)
- Last Synced: 2024-11-11T02:17:41.743Z (3 months ago)
- Topics: google-sheets, google-spreadsheet, google-spreadsheets, now, random, tabletop, twit, twitter, twitter-bot, zeit
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Random Spreadsheet Tweet Bot
- `./index.js` will pull a random cell value from a public Google Spreadsheet with `tabletop` and tweet it with `twit`
- `./now.js` exposes a `/tweet` route via express to do the sameThis is running right now randomly tweeting my band's lyrics once a day: https://mobile.twitter.com/Forester_TN
## configure
### .env
CONSUMER_KEY=pTlxxxxxxxxxxxxxxxuoY
CONSUMER_SECRET=14tNNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSJ1R
ACCESS_TOKEN=1097xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0NPk
ACCESS_TOKEN_SECRET=Y6k2GxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiJk2b
GOOGLE_SHEET_URL=https://docs.google.com/spreadsheets/d/1F9axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrdQo/edit?usp=sharing
GOOGLE_SHEET_HEADER=header### GOOGLE_SHEET_URL
https://www.npmjs.com/package/tabletop#if-your-publish-to-web-url-doesnt-work
### GOOGLE_SHEET_HEADER
the content of your first cell (header cell)
## run
npm start
## deploy
- deploy to now (https://zeit.co/)
- hit the `/tweet` route on a schedule (I use https://cron-job.org)### now.json
You can deploy `./now.js` to now but you have to create a `./now.json` file, and add your now secrets
{
"name": "MyTweetBot",
"version": 2,
"builds": [
{ "src": "now.js", "use": "@now/node" }
],
"routes": [
{ "src": "/(.*)", "dest": "now.js" }
],
"env": {
"CONSUMER_KEY": "@secret-consumer-key",
"CONSUMER_SECRET": "@secret-consumer-secret",
"ACCESS_TOKEN": "@secret-access-token",
"ACCESS_TOKEN_SECRET": "@secret-access-token-secret",
"GOOGLE_SHEET_URL": "https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxx/edit?usp=sharing",
"GOOGLE_SHEET_HEADER": "header"
}
}