{"id":22178372,"url":"https://github.com/newfront/em-aim","last_synced_at":"2025-06-11T16:34:17.139Z","repository":{"id":138837977,"uuid":"2020902","full_name":"newfront/em-aim","owner":"newfront","description":"Event Machine Bindings to the OpenAIM Platform (WebAIM)","archived":false,"fork":false,"pushed_at":"2021-12-09T18:45:29.000Z","size":147,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T18:49:57.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/newfront.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}},"created_at":"2011-07-09T02:08:56.000Z","updated_at":"2021-12-09T18:45:32.000Z","dependencies_parsed_at":"2023-03-12T03:00:18.822Z","dependency_job_id":null,"html_url":"https://github.com/newfront/em-aim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/newfront/em-aim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newfront%2Fem-aim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newfront%2Fem-aim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newfront%2Fem-aim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newfront%2Fem-aim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newfront","download_url":"https://codeload.github.com/newfront/em-aim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newfront%2Fem-aim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259298007,"owners_count":22836440,"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-12-02T08:46:21.215Z","updated_at":"2025-06-11T16:34:17.103Z","avatar_url":"https://github.com/newfront.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rise of the First BOTs: \n\u003e Remember AOL AIM. Did you know it was \"bot-able\". Like SLACK today, AIM could have been so much more.\n\nThis archived project makes me happy. Back in the day AOL instant messenger dominated the world. It was also ahead of its time in many ways including the fact that it could be \n`botted`. The AIM protocol was reverse engineered, and with that came the rise of the first bot processes.\nEventMachine bindings for the OpenAIM (WebAIM APIs)\n\n## Can I use this?\nThere is nothing that still works. The AIM service has been shut down. This is for nostalgia.\n\n## OpenAIM::Session\n\n**getToken**\n~~~\ndef self.getToken(params = {\n  :request_url =\u003e \"\", \n  :query =\u003e {'c'=\u003e'parseToken','devId'=\u003e\"\", 'f' =\u003e \"\", 's' =\u003e \"\",'succUrl'=\u003e'http://anywhere.convorelay.com'}, \n  :timeout =\u003e 10}, \n  \u0026block)\n\n  puts \"GET_AIM_TOKEN: PARAMS: #{params.inspect}\"\n\n  begin\n    http = EventMachine::HttpRequest.new(params[:request_url]).get :query =\u003e params[:query], :timeout =\u003e params[:timeout], :head =\u003e {'x-header' =\u003e 'X-Forwarded-For: 10.0.0.3'}\n\n    http.callback {\n      response = Hashie::Mash.new\n      response.header_status = http.response_header.status\n      response.header = http.response_header\n      response.body = http.response\n      block.call(response)\n    }\n\n  rescue =\u003e e\n    puts \"getToken Failure: #{e}\"\n    block.call(e)\n  end\n\nend\n~~~\n\n**OpenAIM::Session.start**\n~~~\ndef self.start(params = {\n    :request_url =\u003e \"\", \n    :query =\u003e {\n      \"a\"=\u003e\"\",\n      \"anonymous\"=\u003efalse,\n      \"buildNumber\"=\u003e1,\n      \"c\"=\u003e\"parseSessionStartResponse\",\n      \"encodeData\"=\u003efalse,\n      # myInfo\n      # presence\n      # buddylist\n      # typing\n      # im\n      # dataIM\n      # clientError\n      # sessionEnded (don't need to subscribe to this)\n      # offlineIM\n      # sentIM\n      # sentDataIM\n      \"events\"=\u003e\"myInfo,presence,buddylist,im,dataIM,clientError,offlineIM,sentIM,sentDataIM\",\n      \"f\" =\u003e \"\",\n      \"friendly\"=\u003e\"Convo Bot\",\n      \"invisible\"=\u003efalse,\n      # same as devId\n      \"k\"=\u003e\"\",\n      \"majorVersion\"=\u003e0,\n      \"minorVersion\"=\u003e0,\n      \"pointVersion\"=\u003e1,\n      \"pollTimeout\"=\u003e10,\n      \"r\"=\u003e\"\",\n      \"rawMsg\"=\u003efalse,\n      \"ts\"=\u003e \"\"\n      }, \n    :timeout =\u003e 10},\n    \u0026block\n    )\n    #puts params.inspect\n\n    puts \"QUERY: #{params[:query].inspect}\"\n\n    sig_sha256 = calculate_signature_string(\n    {\n      :request_type =\u003e \"GET\",\n      :request_url =\u003e params[:request_url],\n      :data =\u003e\n      {\n        :oauth_consumer_key =\u003e params[:query]['k'],\n        :oauth_token =\u003e params[:query]['a'],\n        :oauth_timestamp =\u003e params[:query]['ts']\n      }\n    })\n\n    puts \"\\nBASE SIGNATURE STRING:: #{sig_sha256.inspect}\\n\"\n\n    http = EventMachine::HttpRequest.new(params[:request_url]).get :query =\u003e params[:query], :timeout =\u003e params[:timeout], :head =\u003e {'x-header' =\u003e 'Content-Type: application/x-www-form-urlencoded'}\n\n    http.callback {\n      p http.response_header.status\n      p http.response_header\n      p http.response\n    }\n\n    block.call(\"hello friends\")\nend\n~~~\n\n**OAuth Signing / Signature Generation**\n~~~\ndef self.calculate_signature(key,text)\n  # HMAC-SHA1\n  # text = Signature Base String\n  # key = \n\n  sig_key = key\n  sig_text = text\n  HMAC::SHA1.digest(sig_key,sig_text)      \nend\n    \ndef self.calculate_signature_string(params={:request_type=\u003e\"GET\",:request_url=\u003e\"\",:data=\u003e{:oauth_consumer_key=\u003e\"\",:oauth_token=\u003e\"\",:oauth_timestamp=\u003e\"\"}})\n  # http://oauth.net/core/1.0/#nonce\n  #Unless otherwise specified by the Service Provider, the timestamp is expressed in the number of seconds since January 1, 1970 00:00:00 GMT. The timestamp value MUST be a positive integer and MUST be equal or greater than the timestamp used in previous requests.\n  #The Consumer SHALL then generate a Nonce value that is unique for all requests with that timestamp. A nonce is a random string, uniquely generated for each request. The nonce allows the Service Provider to verify that a request has never been made before and helps prevent replay attacks when requests are made over a non-secure channel (such as HTTP).\n\n  type = params[:request_type].upcase\n  url = params[:request_url]\n\n  oauth_consumer_key = params[:data][:oauth_consumer_key]\n  oauth_nonce = self.calculate_nonce({:key=\u003eparams[:data][:oauth_consumer_key]})\n  oauth_signature_method = \"HMAC-SHA1\"\n  oauth_token = params[:data][:oauth_token]\n  oauth_timestamp = params[:data][:oauth_timestamp].to_s\n  oauth_version = \"1.0\"\n\n  #puts \"oauth_consumer_key: #{oauth_consumer_key}\"\n  #puts \"oauth_nonce: #{oauth_nonce}\"\n  #puts \"oauth_signature_method: #{oauth_signature_method}\"\n  #puts \"oauth_token: #{oauth_token}\"\n  #puts \"oauth_timestamp: #{oauth_timestamp}\"\n  #puts \"oauth_version: #{oauth_version}\"\n\n\n  base_signature_string = CGI.escape(type+\"\u0026\"+url+\"\u0026oauth_consumer_key=\"+oauth_consumer_key+\"\u0026oauth_nonce=\"+oauth_nonce+\"\u0026oauth_signature_method=\"+oauth_signature_method+\"\u0026oauth_timestamp=\"+oauth_timestamp+\"\u0026oauth_token=\"+oauth_token+\"\u0026oauth_version=\"+oauth_version)\n\n  return base_signature_string\n\nend\n    \ndef self.calculate_nonce params={:key=\u003e\"\"}\n  puts \"calculate_nonce: #{params.inspect}\"\n  begin\n    return Digest::MD5.hexdigest(params[:key])\n  rescue NameError =\u003e e\n    return e\n  rescue TypeError =\u003e e\n    return e\n  end\n\nend\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewfront%2Fem-aim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewfront%2Fem-aim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewfront%2Fem-aim/lists"}