{"id":17942842,"url":"https://github.com/abachman/pat-the-campfire-bot","last_synced_at":"2025-10-27T00:02:08.657Z","repository":{"id":66293796,"uuid":"2101964","full_name":"abachman/pat-the-campfire-bot","owner":"abachman","description":"A Campfire chat bot in node.js, intended to run on Heroku. Built for internal use at Figure53 but you might like it.","archived":false,"fork":false,"pushed_at":"2015-01-22T20:04:20.000Z","size":421,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T03:55:57.818Z","etag":null,"topics":["campfire-bot","chatbot"],"latest_commit_sha":null,"homepage":"http://abachman.github.com/pat-the-campfire-bot","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abachman.png","metadata":{"files":{"readme":"readme.md","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}},"created_at":"2011-07-25T16:09:36.000Z","updated_at":"2023-04-17T00:41:44.000Z","dependencies_parsed_at":"2023-02-20T02:31:08.237Z","dependency_job_id":null,"html_url":"https://github.com/abachman/pat-the-campfire-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abachman%2Fpat-the-campfire-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abachman%2Fpat-the-campfire-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abachman%2Fpat-the-campfire-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abachman%2Fpat-the-campfire-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abachman","download_url":"https://codeload.github.com/abachman/pat-the-campfire-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245289802,"owners_count":20591136,"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":["campfire-bot","chatbot"],"created_at":"2024-10-29T03:07:41.263Z","updated_at":"2025-10-27T00:02:08.552Z","avatar_url":"https://github.com/abachman.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pat the Campfire Bot\n\n*last update: 2011-09-03*\n\nIs what it is, does what it says.\n\nnode.js so that it runs on Heroku. What do you know about bacon strips?\n\nThere are lots of dangling features, some extraneous code and the tests and\nspecs are more like sanity checks. Feel free to ignore anything ugly.\n\nThis is my, \"hey, I should learn node.js\" project and most of it was written in\na burst of activity over the weekend of 2011-07-23.\n\n## dependencies\n\nPat the bot is developed against:\n\n* Javascript\n  * node - 0.4.7\n  * npm - 1.0.18\n  * underscore - 1.1.7\n  * dom-js - 0.0.1\n  * mongoose - 1.7.3\n  * jasmine-node - 1.0.6 (development)\n* Ruby\n  * heroku - 2.3.6\n  * foreman - 0.18.0\n\n## setup\n\n### local\n\n#### 1. install node\n\nmake sure you have node installed. **Version 0.4.7** if you want to run on heroku.\n\n    brew install node -v0.4.7\n\nDo whatever it says to get your `NODE_PATH` env variable set up.\n\n#### 2. install [npm](http://npmjs.org/)\n\nrun the script, that should be enough to get started.\n\n#### 3. clone the repo\n\nthat's a secret\n\n#### 4. install dependencies\n\nI think you cd into the project directory and type `npm install .`. Not sure, but\nI have them installed, so maybe that worked? YMMV.\n\nTo install mongo, all I did was `brew install mongodb` and everything just worked.\n\n#### 5. (optional) heroku support\n\nYou'll need ruby for this. Get it. I recommend [rvm](http://rvm.beginrescueend.com/).\n\n1. `gem install heroku`\n2. `gem install foreman`\n\nThat's all.\n\n### heroku\n\n1. `git push heroku master`\n2. setup 30m ping on http://www.montastic.com/ to make sure the app doesn't get shut off. Heroku\nautomatically turns off any dynos that haven't had a request in the last hour.\n\n## hacking\n\n### local env\n\nI keep a .profile file in my project directory and source it in my shell before\nI start working. This lets me keep private stuff out of the code. It looks like this:\n\n    export campfire_bot_token=12345thisisthetokencampfiregavemeweirdhuh\n    export campfire_bot_account=zoomakroom\n    export campfire_bot_room=100000     # staging\n    export campfire_service_room=100000 # staging\n    # export campfire_bot_room=900000   # production\n    export campfire_logging_room=100000 # bot chatter\n    export PATH=$(npm bin):$PATH\n\nI think that last PATH=$(npm bin):$PATH line is what keeps me, node, foreman,\nand npm happy in my local dev environment.\n\nWherever you deploy, you'll need those five `campfire_*` environment variables.\n\n**NOTE:** `campfire_bot_room` can be a comma separated string, Pat can listen to multiple rooms now!\n\n### running the app\n\nCode you write lives in src/. Everything in lib/ is either straight vendored,\nor generated by `cake build` or `foreman start coffee`.\n\nWhen working on the code, running `foreman start coffee` is recommended to make\nsure lib/ stays up to date. To run the application, run `node lib/bot.js` or\n`foreman start web`. Plain `foreman start` will run the coffee script updater and\nthe web service, but the code won't be up to date when it starts (race condition)\nand the application server doesn't auto-load updated modules. So, you'll have to\nstop and restart the server to see your changes.\n\n### plugins\n\nPlugins live in `src/plugins`. All plugins export an object with a `listen`\nproperty which is a function. A basic echo plugin would look like this:\n\n`src/plugins/echo.coffee`\n\n    module.exports =\n      listen: (message, room) -\u003e room.speak(message.body, console.log)\n\nThe listen method should take two arguments, `message` the message object\nhanded over from Campfire and `room`, the Campfire room the message came from.\n\nIf you want to access the storage classes (User, Quote, Counter, etc.) you will\nhave to require `./lib/store` in the plugin. Take a look at\n`src/plugins/phrases.coffee` for an example.\n\n- - -\n\nBased on [\"Quack-Bot: a campfire bot for Quick Left\"](http://quickleft.com/blog/building-quick-bot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabachman%2Fpat-the-campfire-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabachman%2Fpat-the-campfire-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabachman%2Fpat-the-campfire-bot/lists"}