{"id":15654906,"url":"https://github.com/macournoyer/talker.rb","last_synced_at":"2025-05-01T12:22:13.614Z","repository":{"id":722865,"uuid":"370463","full_name":"macournoyer/talker.rb","owner":"macournoyer","description":"A real-time Talker Ruby client.","archived":false,"fork":false,"pushed_at":"2011-06-02T19:32:49.000Z","size":115,"stargazers_count":25,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T06:09:26.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://talkerapp.com","language":"Ruby","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/macournoyer.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}},"created_at":"2009-11-12T17:23:27.000Z","updated_at":"2024-03-17T14:24:30.000Z","dependencies_parsed_at":"2022-07-20T04:18:02.799Z","dependency_job_id":null,"html_url":"https://github.com/macournoyer/talker.rb","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/macournoyer%2Ftalker.rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macournoyer%2Ftalker.rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macournoyer%2Ftalker.rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macournoyer%2Ftalker.rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macournoyer","download_url":"https://codeload.github.com/macournoyer/talker.rb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251872380,"owners_count":21657634,"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-10-03T12:54:51.037Z","updated_at":"2025-05-01T12:22:13.587Z","avatar_url":"https://github.com/macournoyer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Talker Ruby Client\nA real-time Talker Ruby client.\n\n# Usage\n1) Get a Talker account at https://talkerapp.com/signup\n\n2) Get your Talker Token on https://myaccount.talkerapp.com/settings\n\n3) Serve hot and enjoy\n\n    Talker.connect(:room =\u003e \"Room name\", :token =\u003e YOUR_TALKER_TOKEN) do |client|\n      client.on_connected do\n        client.send_message \"hello!\"\n      end\n      \n      client.on_message do |user, message|\n        puts user[\"name\"] + \": \" + message\n      end\n      \n      trap(\"INT\") { client.close }\n    end\n\n# Callbacks\nAll arguments are optional.\n\n## \u003ccode\u003eon_connected(user)\u003c/code\u003e\nCalled when the user is authenticated and ready to receive events. \"user\" is a Hash containing your user info: \u003ccode\u003e{\"id\"=\u003e1, \"name\"=\u003e\"macournoyer\", \"email\"=\u003e\"macournoyer@talkerapp.com\"}\u003c/code\u003e.\n\n## \u003ccode\u003eon_presence(users)\u003c/code\u003e\nCalled after \u003ccode\u003eon_connected\u003c/code\u003e with the list of connected users.\nWith \u003ccode\u003eusers\u003c/code\u003e being something like this:\n\n    [{\"id\"=\u003e1, \"name\"=\u003e\"macournoyer\", \"email\"=\u003e\"macournoyer@talkerapp.com\"},\n     {\"id\"=\u003e2, \"name\"=\u003e\"gary\", \"email\"=\u003e\"gary@talkerapp.com\"}]\n\n## \u003ccode\u003eon_message(user, message)\u003c/code\u003e\nCalled when a new message is received.\n\u003ccode\u003euser\u003c/code\u003e is the sender.\n\n## \u003ccode\u003eon_private_message(user, message)\u003c/code\u003e\nCalled when a new private message is received.\n\u003ccode\u003euser\u003c/code\u003e is the sender.\n\n## \u003ccode\u003eon_join(user)\u003c/code\u003e\nCalled when a user joins the room.\n\n## \u003ccode\u003eon_idle(user)\u003c/code\u003e\nCalled when a user becomes idle (closed connection without leaving).\n\n## \u003ccode\u003eon_back(user)\u003c/code\u003e\nCalled when a user is back from idle.\n\n## \u003ccode\u003eon_leave(user)\u003c/code\u003e\nCalled when a user leaves.\n\n## \u003ccode\u003eon_close\u003c/code\u003e\nCalled when the connection is closed.\n\n## \u003ccode\u003eon_error(error_message)\u003c/code\u003e\nCalled when an error is received from the Talker server.\n\n## \u003ccode\u003eon_event(event)\u003c/code\u003e\nCalled when any kind of event (all of the above) is received. \"event\" is a Hash: \u003ccode\u003e{\"type\":\"event type\",\"id\":\"unique ID\",... event specific attributes}\u003c/code\u003e.\n\n# Methods\nMethods of an instance of Talker class.\n\n## \u003ccode\u003ecurrent_user\u003c/code\u003e\nInfo about the user currently connected, \u003ccode\u003enil\u003c/code\u003e if not yet connected:\n\n    {\"id\"=\u003e1, \"name\"=\u003e\"macournoyer\", \"email\"=\u003e\"macournoyer@talkerapp.com\"}\n\n## \u003ccode\u003eusers\u003c/code\u003e\nArray of users currently in the room. In the form:\n\n    [{\"id\"=\u003e1, \"name\"=\u003e\"macournoyer\", \"email\"=\u003e\"macournoyer@talkerapp.com\"},\n     {\"id\"=\u003e2, \"name\"=\u003e\"gary\", \"email\"=\u003e\"gary@talkerapp.com\"}]\n\n## \u003ccode\u003eleave\u003c/code\u003e\nLeave the room and close the connection.\n\n## \u003ccode\u003eclose\u003c/code\u003e\nClose the connection without leaving the room.\n\n## \u003ccode\u003esend_message(message)\u003c/code\u003e\nSend a message.\n\n## \u003ccode\u003esend_private_message(user_name, message)\u003c/code\u003e\nSend a private message to \u003ccode\u003euser_name\u003c/code\u003e.\n\n# Running the specs\nHowdy brave lil' one! To run the specs you'll need courage, hard work and some luck:\n\n1) Install from source my \"special\" fork of em-spec at http://github.com/macournoyer/em-spec.\n\n2) Edit the file spec/talker.example.yml with your info and rename it to spec/talker.yml.\n\n3) Run \u003ccode\u003erake\u003c/code\u003e and everything should be green, birds should start signing and someone will make you a chocolate cake\n\n(results may vary).\n\n# Credits \u0026 License\nReleased under the Ruby License, (c) Talker\n\nThanks to http://github.com/raggi for kicking this off.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacournoyer%2Ftalker.rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacournoyer%2Ftalker.rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacournoyer%2Ftalker.rb/lists"}