GitHub PullRequestReviewCommentEvent at 2014-11-21 01:36:08
Repository: ruby-exercise
Actor: lcpriest
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/comments/20692404","id":20692404,"diff_hunk":"@@ -0,0 +1,59 @@\n+require 'twitter'\n+require 'googl'\n+\n+module Ejaydj\n+  module Djs\n+    class TwitterBot < Ejaydj::Dj\n+      attr_accessor :twitter_consumer_key,\n+                    :twitter_consumer_secret,\n+                    :twitter_access_token,\n+                    :twitter_access_token_secret,\n+                    :twitter_client\n+\n+      MAX_SONG_LENGTH   = 50\n+      MAX_ARTIST_LENGTH = 50\n+\n+      def initialize(attributes={}, &block)\n+        super(attributes, &block)\n+      end\n+\n+      def tweet_me_a_song(time: Time.now)\n+        @song = play_me_a_song(time: time)\n+        tweet = tweet_string\n+\n+        twitter_client.update(tweet)\n+\n+        {message: tweet, song: @song}\n+      end\n+\n+      private\n+\n+      def tweet_string\n+        tweet_string = (\"NP: #{@song.name} by #{@song.artist} from playlist: #{shorten_url(@song.playlist.url)}\")\n+        shorten_tweet(tweet_string)\n+      end\n+\n+      def shorten_tweet(tweet_string)\n+        return tweet_string unless tweet_string.length > 140\n+\n+        @song.name    = \"#{@song.name[0..MAX_SONG_LENGTH]}...\" if @song.name.length > MAX_SONG_LENGTH\n+        @song.artist  = \"#{@song.artist[0..MAX_ARTIST_LENGTH]}...\" if @song.artist.length > MAX_ARTIST_LENGTH","path":"vendor/gem/ejaydj/lib/ejaydj/djs/twitter_bot.rb","position":40,"original_position":40,"commit_id":"3a7aeaf0795cdc6747e640aa7d54a08431d817f0","original_commit_id":"3a7aeaf0795cdc6747e640aa7d54a08431d817f0","user":{"login":"lcpriest","id":735593,"avatar_url":"https://avatars.githubusercontent.com/u/735593?v=3","gravatar_id":"","url":"https://api.github.com/users/lcpriest","html_url":"https://github.com/lcpriest","followers_url":"https://api.github.com/users/lcpriest/followers","following_url":"https://api.github.com/users/lcpriest/following{/other_user}","gists_url":"https://api.github.com/users/lcpriest/gists{/gist_id}","starred_url":"https://api.github.com/users/lcpriest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcpriest/subscriptions","organizations_url":"https://api.github.com/users/lcpriest/orgs","repos_url":"https://api.github.com/users/lcpriest/repos","events_url":"https://api.github.com/users/lcpriest/events{/privacy}","received_events_url":"https://api.github.com/users/lcpriest/received_events","type":"User","site_admin":false},"body":"My I ask why you prefer this over truncate?","created_at":"2014-11-21T01:36:08Z","updated_at":"2014-11-21T01:36:08Z","html_url":"https://github.com/tradegecko/ruby-exercise/pull/1#discussion_r20692404","pull_request_url":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/comments/20692404"},"html":{"href":"https://github.com/tradegecko/ruby-exercise/pull/1#discussion_r20692404"},"pull_request":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/1","id":24778477,"html_url":"https://github.com/tradegecko/ruby-exercise/pull/1","diff_url":"https://github.com/tradegecko/ruby-exercise/pull/1.diff","patch_url":"https://github.com/tradegecko/ruby-exercise/pull/1.patch","issue_url":"https://api.github.com/repos/tradegecko/ruby-exercise/issues/1","number":1,"state":"open","locked":false,"title":"Add ejaydj codes","user":{"login":"ejaypcanaria","id":5291164,"avatar_url":"https://avatars.githubusercontent.com/u/5291164?v=3","gravatar_id":"","url":"https://api.github.com/users/ejaypcanaria","html_url":"https://github.com/ejaypcanaria","followers_url":"https://api.github.com/users/ejaypcanaria/followers","following_url":"https://api.github.com/users/ejaypcanaria/following{/other_user}","gists_url":"https://api.github.com/users/ejaypcanaria/gists{/gist_id}","starred_url":"https://api.github.com/users/ejaypcanaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejaypcanaria/subscriptions","organizations_url":"https://api.github.com/users/ejaypcanaria/orgs","repos_url":"https://api.github.com/users/ejaypcanaria/repos","events_url":"https://api.github.com/users/ejaypcanaria/events{/privacy}","received_events_url":"https://api.github.com/users/ejaypcanaria/received_events","type":"User","site_admin":false},"body":"Codes added from my gem: https://github.com/ejaypcanaria/ejaydj for review purpose only.","created_at":"2014-11-20T16:35:43Z","updated_at":"2014-11-21T01:36:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d44129f9a92a6e114619c01b5943f3904a56f70b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/1/commits","review_comments_url":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/1/comments","review_comment_url":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/comments/{number}","comments_url":"https://api.github.com/repos/tradegecko/ruby-exercise/issues/1/comments","statuses_url":"https://api.github.com/repos/tradegecko/ruby-exercise/statuses/3a7aeaf0795cdc6747e640aa7d54a08431d817f0","head":{"label":"ejaypcanaria:master","ref":"master","sha":"3a7aeaf0795cdc6747e640aa7d54a08431d817f0","user":{"login":"ejaypcanaria","id":5291164,"avatar_url":"https://avatars.githubusercontent.com/u/5291164?v=3","gravatar_id":"","url":"https://api.github.com/users/ejaypcanaria","html_url":"https://github.com/ejaypcanaria","followers_url":"https://api.github.com/users/ejaypcanaria/followers","following_url":"https://api.github.com/users/ejaypcanaria/following{/other_user}","gists_url":"https://api.github.com/users/ejaypcanaria/gists{/gist_id}","starred_url":"https://api.github.com/users/ejaypcanaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejaypcanaria/subscriptions","organizations_url":"https://api.github.com/users/ejaypcanaria/orgs","repos_url":"https://api.github.com/users/ejaypcanaria/repos","events_url":"https://api.github.com/users/ejaypcanaria/events{/privacy}","received_events_url":"https://api.github.com/users/ejaypcanaria/received_events","type":"User","site_admin":false},"repo":{"id":26920177,"name":"ruby-exercise","full_name":"ejaypcanaria/ruby-exercise","owner":{"login":"ejaypcanaria","id":5291164,"avatar_url":"https://avatars.githubusercontent.com/u/5291164?v=3","gravatar_id":"","url":"https://api.github.com/users/ejaypcanaria","html_url":"https://github.com/ejaypcanaria","followers_url":"https://api.github.com/users/ejaypcanaria/followers","following_url":"https://api.github.com/users/ejaypcanaria/following{/other_user}","gists_url":"https://api.github.com/users/ejaypcanaria/gists{/gist_id}","starred_url":"https://api.github.com/users/ejaypcanaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejaypcanaria/subscriptions","organizations_url":"https://api.github.com/users/ejaypcanaria/orgs","repos_url":"https://api.github.com/users/ejaypcanaria/repos","events_url":"https://api.github.com/users/ejaypcanaria/events{/privacy}","received_events_url":"https://api.github.com/users/ejaypcanaria/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ejaypcanaria/ruby-exercise","description":null,"fork":true,"url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise","forks_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/forks","keys_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/teams","hooks_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/hooks","issue_events_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/issues/events{/number}","events_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/events","assignees_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/assignees{/user}","branches_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/branches{/branch}","tags_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/tags","blobs_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/git/refs{/sha}","trees_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/statuses/{sha}","languages_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/languages","stargazers_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/stargazers","contributors_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/contributors","subscribers_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/subscribers","subscription_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/subscription","commits_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/commits{/sha}","git_commits_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/git/commits{/sha}","comments_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/comments{/number}","issue_comment_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/issues/comments/{number}","contents_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/contents/{+path}","compare_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/merges","archive_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/downloads","issues_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/issues{/number}","pulls_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/pulls{/number}","milestones_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/milestones{/number}","notifications_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/labels{/name}","releases_url":"https://api.github.com/repos/ejaypcanaria/ruby-exercise/releases{/id}","created_at":"2014-11-20T16:06:04Z","updated_at":"2014-11-20T16:34:29Z","pushed_at":"2014-11-20T16:34:28Z","git_url":"git://github.com/ejaypcanaria/ruby-exercise.git","ssh_url":"git@github.com:ejaypcanaria/ruby-exercise.git","clone_url":"https://github.com/ejaypcanaria/ruby-exercise.git","svn_url":"https://github.com/ejaypcanaria/ruby-exercise","homepage":null,"size":112,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"tradegecko:master","ref":"master","sha":"f627b2aff6d944946a71f71b306b44d61f6aff8d","user":{"login":"tradegecko","id":1814492,"avatar_url":"https://avatars.githubusercontent.com/u/1814492?v=3","gravatar_id":"","url":"https://api.github.com/users/tradegecko","html_url":"https://github.com/tradegecko","followers_url":"https://api.github.com/users/tradegecko/followers","following_url":"https://api.github.com/users/tradegecko/following{/other_user}","gists_url":"https://api.github.com/users/tradegecko/gists{/gist_id}","starred_url":"https://api.github.com/users/tradegecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tradegecko/subscriptions","organizations_url":"https://api.github.com/users/tradegecko/orgs","repos_url":"https://api.github.com/users/tradegecko/repos","events_url":"https://api.github.com/users/tradegecko/events{/privacy}","received_events_url":"https://api.github.com/users/tradegecko/received_events","type":"Organization","site_admin":false},"repo":{"id":25526304,"name":"ruby-exercise","full_name":"tradegecko/ruby-exercise","owner":{"login":"tradegecko","id":1814492,"avatar_url":"https://avatars.githubusercontent.com/u/1814492?v=3","gravatar_id":"","url":"https://api.github.com/users/tradegecko","html_url":"https://github.com/tradegecko","followers_url":"https://api.github.com/users/tradegecko/followers","following_url":"https://api.github.com/users/tradegecko/following{/other_user}","gists_url":"https://api.github.com/users/tradegecko/gists{/gist_id}","starred_url":"https://api.github.com/users/tradegecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tradegecko/subscriptions","organizations_url":"https://api.github.com/users/tradegecko/orgs","repos_url":"https://api.github.com/users/tradegecko/repos","events_url":"https://api.github.com/users/tradegecko/events{/privacy}","received_events_url":"https://api.github.com/users/tradegecko/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tradegecko/ruby-exercise","description":null,"fork":true,"url":"https://api.github.com/repos/tradegecko/ruby-exercise","forks_url":"https://api.github.com/repos/tradegecko/ruby-exercise/forks","keys_url":"https://api.github.com/repos/tradegecko/ruby-exercise/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tradegecko/ruby-exercise/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tradegecko/ruby-exercise/teams","hooks_url":"https://api.github.com/repos/tradegecko/ruby-exercise/hooks","issue_events_url":"https://api.github.com/repos/tradegecko/ruby-exercise/issues/events{/number}","events_url":"https://api.github.com/repos/tradegecko/ruby-exercise/events","assignees_url":"https://api.github.com/repos/tradegecko/ruby-exercise/assignees{/user}","branches_url":"https://api.github.com/repos/tradegecko/ruby-exercise/branches{/branch}","tags_url":"https://api.github.com/repos/tradegecko/ruby-exercise/tags","blobs_url":"https://api.github.com/repos/tradegecko/ruby-exercise/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tradegecko/ruby-exercise/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tradegecko/ruby-exercise/git/refs{/sha}","trees_url":"https://api.github.com/repos/tradegecko/ruby-exercise/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tradegecko/ruby-exercise/statuses/{sha}","languages_url":"https://api.github.com/repos/tradegecko/ruby-exercise/languages","stargazers_url":"https://api.github.com/repos/tradegecko/ruby-exercise/stargazers","contributors_url":"https://api.github.com/repos/tradegecko/ruby-exercise/contributors","subscribers_url":"https://api.github.com/repos/tradegecko/ruby-exercise/subscribers","subscription_url":"https://api.github.com/repos/tradegecko/ruby-exercise/subscription","commits_url":"https://api.github.com/repos/tradegecko/ruby-exercise/commits{/sha}","git_commits_url":"https://api.github.com/repos/tradegecko/ruby-exercise/git/commits{/sha}","comments_url":"https://api.github.com/repos/tradegecko/ruby-exercise/comments{/number}","issue_comment_url":"https://api.github.com/repos/tradegecko/ruby-exercise/issues/comments/{number}","contents_url":"https://api.github.com/repos/tradegecko/ruby-exercise/contents/{+path}","compare_url":"https://api.github.com/repos/tradegecko/ruby-exercise/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tradegecko/ruby-exercise/merges","archive_url":"https://api.github.com/repos/tradegecko/ruby-exercise/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tradegecko/ruby-exercise/downloads","issues_url":"https://api.github.com/repos/tradegecko/ruby-exercise/issues{/number}","pulls_url":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls{/number}","milestones_url":"https://api.github.com/repos/tradegecko/ruby-exercise/milestones{/number}","notifications_url":"https://api.github.com/repos/tradegecko/ruby-exercise/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tradegecko/ruby-exercise/labels{/name}","releases_url":"https://api.github.com/repos/tradegecko/ruby-exercise/releases{/id}","created_at":"2014-10-21T14:17:31Z","updated_at":"2014-10-21T14:29:16Z","pushed_at":"2014-11-06T03:45:24Z","git_url":"git://github.com/tradegecko/ruby-exercise.git","ssh_url":"git@github.com:tradegecko/ruby-exercise.git","clone_url":"https://github.com/tradegecko/ruby-exercise.git","svn_url":"https://github.com/tradegecko/ruby-exercise","homepage":null,"size":136,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/1"},"html":{"href":"https://github.com/tradegecko/ruby-exercise/pull/1"},"issue":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/issues/1"},"comments":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/tradegecko/ruby-exercise/statuses/3a7aeaf0795cdc6747e640aa7d54a08431d817f0"}}}}