{"id":15427514,"url":"https://github.com/teleyinex/farcaster-bot","last_synced_at":"2025-04-19T16:34:12.660Z","repository":{"id":176328123,"uuid":"655361461","full_name":"teleyinex/farcaster-bot","owner":"teleyinex","description":"A simple Farcaster bot using Github Actions and Google Spreadsheets","archived":false,"fork":false,"pushed_at":"2023-09-22T16:50:54.000Z","size":25,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T10:11:25.752Z","etag":null,"topics":["bot","farcaster"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teleyinex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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}},"created_at":"2023-06-18T17:00:16.000Z","updated_at":"2024-12-01T10:32:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"5deea726-a216-4587-bdca-b7ca31bbbafe","html_url":"https://github.com/teleyinex/farcaster-bot","commit_stats":null,"previous_names":["teleyinex/farcaster-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teleyinex%2Ffarcaster-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teleyinex%2Ffarcaster-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teleyinex%2Ffarcaster-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teleyinex%2Ffarcaster-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teleyinex","download_url":"https://codeload.github.com/teleyinex/farcaster-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249738800,"owners_count":21318504,"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":["bot","farcaster"],"created_at":"2024-10-01T18:00:38.776Z","updated_at":"2025-04-19T16:34:12.643Z","avatar_url":"https://github.com/teleyinex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Farcaster bot\n\nWelcome! This is just a simple farcaster bot that allows you to cast text messages using:\n\n- Github Actions (using the cron feature, so you can cast every N minutes)\n- Google Spreadsheets (so you can share it with your friends and team to add new casts that will be casted automagically)\n\n## Requirements\n\nBefore you start, you will need two things:\n\n- A Farcaster account\n- A Google Service account\n\n### Farcaster accounts\n\nGetting one nowadays should be easier (ask me as I might have some invitations left). If you have one,\nall you have to do is use your \"secret words\" (aka mnemonic) to authenticate and cast.\n\nYou might not be confortable using your personal account for this, so the best way is to get another invite\nand create for yourself a new account if you want to try this bot.\n\nOnce you have the account, extract the mnemonic and save it in a .env file like this:\n\n```\nFARCASTER_MNEMONIC = \"your words\"\n```\n\n### Google Spreadsheet Service Account\n\nNow, you need to create in your Google Cloud a service account for accessing programatically your Google Drive.\n\nFirst, you will need to create a project. Go to console.cloud.google.com and proceed.\n\nOnce you have created the project, select it. Then, go to the IAM \u0026 Admin section, and there select the\nService Accounts section.\n\nThere you should see the option of creating a new service account. Name it. Once you have it, create an associated key. Choose JSON format.\n\nSave the file that you have downloaded, and keep it safe. Then you will need to give permissions to your app to access the Google Sheets API.\nJust go to the API \u0026 Services, and enable it. If you click in the Credentials section you should see your previous created credential.\n\nCopy the email of your service account, as you will need to share your spreadsheet with that email as an editor.\n\n#### Saving the JSON credentials as an encoded base64 string\n\nWe will store the JSON file as an encoded base64 string because we will be using Github Actions for running the script.\n\nNOTE: JSON data is not handled well with Github Actions secrets, so the best solution I've found is that.\n\nOnce you have the JSON as a base64 string, just save it in your .env file like this:\n\n```\nGOOGLE_AUTH = base64string\n```\n\n#### Spreadsheet with your content\n\nNow time to create the Spreadsheet that you will be sharing with your Service Account (and probably your friends).\n\nJust go to Google and create one. It will need to have at least 2 sheets:\n\n- First one named: dashboard\n- Second one named: whatever you want (i.e casts).\n\nThe first one is really important because it is our index or dashboard. In the cell A1 you will have the latest\nsheet used to cast a message. If you are following now the tutorial, you should write in your cell A1 casts (if you named\nyour second sheet 'casts').\n\nThen, in the second sheet you can start adding casts as you want. The idea is each row is a cast.\nYou should be using only A column and write there your quotes, messages, whatever.\n\nIn order to get the script running you will need to add in the column B the following word: \"last\".\nWhy? Because that will instruct the script to know which was the last cast that has been casted, choosing the next one\nand casting it (obviously, it will update the status of last to this last one).\n\nYou can have as many sheets as you want. The idea is that they could serve as topics for your casts:\n\n- Support casts\n- Quotes\n- Nice things\n- ...\n\nThe script will iterate over each sheet in a round robin fashion. This will enable you to have more topics, and your bot\nwill seem more interesting (or maybe not).\n\nNow copy the URL of the file and save it in the .env file:\n\n```\nURL = 'your url'\n```\n\n### Installing libraries\n\nNow that you have all setup, you need to install the libraries:\n\n```\npython -menv env\nsource env/bin/activate\npip install -r requirements.txt\n```\n\nNOTE: Use python 3.8 to 3.10. The Farcaster library doesn't support python 3.11.\n\nYou can now try to cast from your laptop:\n\n```\npython app.py\n```\n\nIf you don't see any message, it means it worked! Go to your Farcaster account and check if you see the message.\nIf you see it, everything is ok and we can move into the next phase: casting automagically thanks to Github Actions.\n\n### Setting up Github Actions\n\nAs you will see, this repo has a github action named \"farcaster.yml\". There you will see several repository secrets.\n\nThose secrets should be created in the config section of the repository copying the values of your .env file.\n\nOnce you have it, adapt the timing (by default casts 4 times per day).\n\nEnjoy!!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteleyinex%2Ffarcaster-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteleyinex%2Ffarcaster-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteleyinex%2Ffarcaster-bot/lists"}