{"action":"created","comment":{"url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/comments/48838281","id":48838281,"diff_hunk":"@@ -1,27 +1,26 @@\n #!/usr/bin/env ruby\n-require 'net/http'\n+require 'twitter'\n \n # Track public available information of a twitter user like follower, follower\n # and tweet count by scraping the user profile page.\n \n # Config\n # ------\n+\n twitter_username = ENV['TWITTER_USERNAME'] || 'foobugs'\n \n-SCHEDULER.every '2m', :first_in => 0 do |job|\n-  http = Net::HTTP.new(\"twitter.com\", Net::HTTP.https_default_port())\n-  http.use_ssl = true\n-  response = http.request(Net::HTTP::Get.new(\"/#{twitter_username}\"))\n-  if response.code != \"200\"\n-    puts \"twitter communication error (status-code: #{response.code})\\n#{response.body}\"\n-  else\n+Twitter.configure do |config|\n+  config.consumer_key = YOUR_CONSUMER_KEY\n+  config.consumer_secret = YOUR_CONSUMER_SECRET\n+  config.oauth_token = YOUR_OAUTH_TOKEN\n+  config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET\n+end\n \n-    tweets = /profile[\"']>[\\n\\t\\s]*<strong>([\\d.]+)/.match(response.body)[1].delete('.').to_i\n-    following = /following[\"']>[\\n\\t\\s]*<strong>([\\d.]+)/.match(response.body)[1].delete('.').to_i\n-    followers = /followers[\"']>[\\n\\t\\s]*<strong>([\\d.]+)/.match(response.body)[1].delete('.').to_i\n-    \n-    send_event('twitter_user_tweets', current: tweets)\n-    send_event('twitter_user_followers', current: followers)\n-    send_event('twitter_user_following', current: following)\n-  end\n-end\n\\ No newline at end of file\n+twitter_username = ENV['TWITTER_USERNAME'] || 'foobugs'","path":"jobs/twitter_user.rb","position":37,"original_position":37,"commit_id":"bf026f789f2b31448e4fb00136438721f3b4b94f","original_commit_id":"bf026f789f2b31448e4fb00136438721f3b4b94f","user":{"login":"Ephigenia","id":73654,"avatar_url":"https://avatars.githubusercontent.com/u/73654?v=3","gravatar_id":"","url":"https://api.github.com/users/Ephigenia","html_url":"https://github.com/Ephigenia","followers_url":"https://api.github.com/users/Ephigenia/followers","following_url":"https://api.github.com/users/Ephigenia/following{/other_user}","gists_url":"https://api.github.com/users/Ephigenia/gists{/gist_id}","starred_url":"https://api.github.com/users/Ephigenia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ephigenia/subscriptions","organizations_url":"https://api.github.com/users/Ephigenia/orgs","repos_url":"https://api.github.com/users/Ephigenia/repos","events_url":"https://api.github.com/users/Ephigenia/events{/privacy}","received_events_url":"https://api.github.com/users/Ephigenia/received_events","type":"User","site_admin":false},"body":"yes it is, as I’m no going to accept this pull request as it needs to have oauth keys configured which is more complicated than just adding the username","created_at":"2016-01-05T12:04:12Z","updated_at":"2016-01-05T12:04:12Z","html_url":"https://github.com/Ephigenia/foobugs-dashboard/pull/3#discussion_r48838281","pull_request_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/comments/48838281"},"html":{"href":"https://github.com/Ephigenia/foobugs-dashboard/pull/3#discussion_r48838281"},"pull_request":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/3","id":5156949,"html_url":"https://github.com/Ephigenia/foobugs-dashboard/pull/3","diff_url":"https://github.com/Ephigenia/foobugs-dashboard/pull/3.diff","patch_url":"https://github.com/Ephigenia/foobugs-dashboard/pull/3.patch","issue_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/issues/3","number":3,"state":"open","locked":false,"title":"Use JSON api instead of scraping HTML","user":{"login":"doodlemoonch","id":213453,"avatar_url":"https://avatars.githubusercontent.com/u/213453?v=3","gravatar_id":"","url":"https://api.github.com/users/doodlemoonch","html_url":"https://github.com/doodlemoonch","followers_url":"https://api.github.com/users/doodlemoonch/followers","following_url":"https://api.github.com/users/doodlemoonch/following{/other_user}","gists_url":"https://api.github.com/users/doodlemoonch/gists{/gist_id}","starred_url":"https://api.github.com/users/doodlemoonch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doodlemoonch/subscriptions","organizations_url":"https://api.github.com/users/doodlemoonch/orgs","repos_url":"https://api.github.com/users/doodlemoonch/repos","events_url":"https://api.github.com/users/doodlemoonch/events{/privacy}","received_events_url":"https://api.github.com/users/doodlemoonch/received_events","type":"User","site_admin":false},"body":"I updated the twitter job to use the JSON API","created_at":"2013-04-15T07:57:53Z","updated_at":"2016-01-05T12:04:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8a26cc2dc2858ef2b67493ab2602a5ef236629a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/issues/3/comments","statuses_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/statuses/bf026f789f2b31448e4fb00136438721f3b4b94f","head":{"label":"doodlemoonch:master","ref":"master","sha":"bf026f789f2b31448e4fb00136438721f3b4b94f","user":{"login":"doodlemoonch","id":213453,"avatar_url":"https://avatars.githubusercontent.com/u/213453?v=3","gravatar_id":"","url":"https://api.github.com/users/doodlemoonch","html_url":"https://github.com/doodlemoonch","followers_url":"https://api.github.com/users/doodlemoonch/followers","following_url":"https://api.github.com/users/doodlemoonch/following{/other_user}","gists_url":"https://api.github.com/users/doodlemoonch/gists{/gist_id}","starred_url":"https://api.github.com/users/doodlemoonch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doodlemoonch/subscriptions","organizations_url":"https://api.github.com/users/doodlemoonch/orgs","repos_url":"https://api.github.com/users/doodlemoonch/repos","events_url":"https://api.github.com/users/doodlemoonch/events{/privacy}","received_events_url":"https://api.github.com/users/doodlemoonch/received_events","type":"User","site_admin":false},"repo":{"id":9443514,"name":"foobugs-dashboard","full_name":"doodlemoonch/foobugs-dashboard","owner":{"login":"doodlemoonch","id":213453,"avatar_url":"https://avatars.githubusercontent.com/u/213453?v=3","gravatar_id":"","url":"https://api.github.com/users/doodlemoonch","html_url":"https://github.com/doodlemoonch","followers_url":"https://api.github.com/users/doodlemoonch/followers","following_url":"https://api.github.com/users/doodlemoonch/following{/other_user}","gists_url":"https://api.github.com/users/doodlemoonch/gists{/gist_id}","starred_url":"https://api.github.com/users/doodlemoonch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doodlemoonch/subscriptions","organizations_url":"https://api.github.com/users/doodlemoonch/orgs","repos_url":"https://api.github.com/users/doodlemoonch/repos","events_url":"https://api.github.com/users/doodlemoonch/events{/privacy}","received_events_url":"https://api.github.com/users/doodlemoonch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/doodlemoonch/foobugs-dashboard","description":"dashing dashboard for foobugs","fork":true,"url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard","forks_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/forks","keys_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/teams","hooks_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/hooks","issue_events_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/events","assignees_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/tags","blobs_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/languages","stargazers_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/stargazers","contributors_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/contributors","subscribers_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/subscribers","subscription_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/subscription","commits_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/merges","archive_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/downloads","issues_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/doodlemoonch/foobugs-dashboard/releases{/id}","created_at":"2013-04-15T07:56:08Z","updated_at":"2015-09-20T11:58:06Z","pushed_at":"2013-04-15T10:58:29Z","git_url":"git://github.com/doodlemoonch/foobugs-dashboard.git","ssh_url":"git@github.com:doodlemoonch/foobugs-dashboard.git","clone_url":"https://github.com/doodlemoonch/foobugs-dashboard.git","svn_url":"https://github.com/doodlemoonch/foobugs-dashboard","homepage":null,"size":713,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ephigenia:master","ref":"master","sha":"860c04e47318f4e734474abe1dd20663e8cdbd3d","user":{"login":"Ephigenia","id":73654,"avatar_url":"https://avatars.githubusercontent.com/u/73654?v=3","gravatar_id":"","url":"https://api.github.com/users/Ephigenia","html_url":"https://github.com/Ephigenia","followers_url":"https://api.github.com/users/Ephigenia/followers","following_url":"https://api.github.com/users/Ephigenia/following{/other_user}","gists_url":"https://api.github.com/users/Ephigenia/gists{/gist_id}","starred_url":"https://api.github.com/users/Ephigenia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ephigenia/subscriptions","organizations_url":"https://api.github.com/users/Ephigenia/orgs","repos_url":"https://api.github.com/users/Ephigenia/repos","events_url":"https://api.github.com/users/Ephigenia/events{/privacy}","received_events_url":"https://api.github.com/users/Ephigenia/received_events","type":"User","site_admin":false},"repo":{"id":8904702,"name":"foobugs-dashboard","full_name":"Ephigenia/foobugs-dashboard","owner":{"login":"Ephigenia","id":73654,"avatar_url":"https://avatars.githubusercontent.com/u/73654?v=3","gravatar_id":"","url":"https://api.github.com/users/Ephigenia","html_url":"https://github.com/Ephigenia","followers_url":"https://api.github.com/users/Ephigenia/followers","following_url":"https://api.github.com/users/Ephigenia/following{/other_user}","gists_url":"https://api.github.com/users/Ephigenia/gists{/gist_id}","starred_url":"https://api.github.com/users/Ephigenia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ephigenia/subscriptions","organizations_url":"https://api.github.com/users/Ephigenia/orgs","repos_url":"https://api.github.com/users/Ephigenia/repos","events_url":"https://api.github.com/users/Ephigenia/events{/privacy}","received_events_url":"https://api.github.com/users/Ephigenia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ephigenia/foobugs-dashboard","description":"various dashing dashboard jobs","fork":false,"url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard","forks_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/forks","keys_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/teams","hooks_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/hooks","issue_events_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/events","assignees_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/tags","blobs_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/languages","stargazers_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/stargazers","contributors_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/contributors","subscribers_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/subscribers","subscription_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/subscription","commits_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/merges","archive_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/downloads","issues_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/releases{/id}","created_at":"2013-03-20T13:26:26Z","updated_at":"2016-01-04T18:03:56Z","pushed_at":"2014-07-16T07:39:52Z","git_url":"git://github.com/Ephigenia/foobugs-dashboard.git","ssh_url":"git@github.com:Ephigenia/foobugs-dashboard.git","clone_url":"https://github.com/Ephigenia/foobugs-dashboard.git","svn_url":"https://github.com/Ephigenia/foobugs-dashboard","homepage":"http://foobugs-dashboard.herokuapp.com/","size":953,"stargazers_count":47,"watchers_count":47,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":1,"forks":36,"open_issues":1,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/3"},"html":{"href":"https://github.com/Ephigenia/foobugs-dashboard/pull/3"},"issue":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/issues/3"},"comments":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Ephigenia/foobugs-dashboard/statuses/bf026f789f2b31448e4fb00136438721f3b4b94f"}}}}