{"action":"created","comment":{"url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/comments/40418967","id":40418967,"diff_hunk":"@@ -0,0 +1,92 @@\n+# Guide to Solving and Reviewing Tweet Shortener\n+\n+Before we start coding our methods, we need to create a hash where our methods can look up which word needs to be substituted.\n+\n+```ruby\n+def dictionary\n+  dictionary = {\n+    \"too\" => \"2\",\n+    \"to\" => \"2\",\n+    \"two\" =>\"2\",\n+    \"four\" => \"4\",\n+    \"for\" => \"4\",\n+    \"be\" => \"b\",\n+    \"you\" => \"u\",\n+    \"at\" => \"@\",\n+    \"and\" => \"&\"\n+  }\n+end\n+```\n+\n+### `word_substituter`\n+\n+Let us start with defining our `word_substituter` method. This method will also take in an argument `tweet`.\n+\n+```ruby\n+def word_substituter(tweet)\n+end\n+```\n+After putting a `binding.pry` in our method, we know that the passed in `tweet` is a sting.\n+\n+We need to split the string to get every word individually, then we need to iterate over every word in our string to compare these words to our `dictionary` hash. If the downcased word is a key in our hash, then we need to replace that word with it substitute, else we need to return that word. Also we need to `join` every word back to a string. \n+\n+\n+```ruby\n+def word_substituter(tweet)\n+  tweet.split.collect do |word|\n+    if dictionary.keys.include?(word.downcase)\n+      word = dictionary[word.downcase]\n+    else\n+      word\n+    end\n+  end.join(\" \")\n+end\n+```\n+\n+### `#bulk_tweet_shortener`\n+\n+The `bulk_tweet_shortener` method will take in an array of tweets and shorten those tweets one by one. We already have a method that does the individual shortening of tweets, let us just use that method and pass in every tweet. The test also expects that we `puts` the tweets.\n+\n+```ruby\n+def bulk_tweet_shortener(tweets)\n+  tweets.each do |tweet|\n+    puts word_substituter(tweet)\n+  end\n+end\n+```\n+\n+### `#selective_tweet_shortener`\n+\n+The two tests we have to pass for this method are:\n+\n+```bash\n+shortens tweets that are more than 140 characters\n+does not shorten tweets that are less than 130 characters\n+```\n+After passing a tweet, this method should check if the tweet is longer than 140 characters. If the answer is yes, we should use our first method `word_substituter` to shorten the tweet, else we just have to return the unchanged tweet.\n+\n+```ruby\n+def selective_tweet_shortener(tweet)\n+  if tweet.length > 140\n+    word_substituter(tweet)\n+  else\n+    tweet\n+  end\n+end\n+```\n+\n+### `#shortened_tweet_truncator`\n+\n+This `shortened_tweet_truncator` method will truncate your tweet if the tweet is still longer than 140 character after the `word_substituter` method has run. The truncated tweet should only be 140 characters including `...` in the end. \n+\n+```ruby\n+def shortened_tweet_truncator(tweet)\n+  if word_substituter(tweet).length > 140\n+    word_substituter(tweet)[0..136] + ('...')","path":"TUTORIAL.md","position":85,"original_position":85,"commit_id":"798a64cf620492a841608fd59b3a10be149600a3","original_commit_id":"798a64cf620492a841608fd59b3a10be149600a3","user":{"login":"jmburges","id":58342,"avatar_url":"https://avatars.githubusercontent.com/u/58342?v=3","gravatar_id":"","url":"https://api.github.com/users/jmburges","html_url":"https://github.com/jmburges","followers_url":"https://api.github.com/users/jmburges/followers","following_url":"https://api.github.com/users/jmburges/following{/other_user}","gists_url":"https://api.github.com/users/jmburges/gists{/gist_id}","starred_url":"https://api.github.com/users/jmburges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmburges/subscriptions","organizations_url":"https://api.github.com/users/jmburges/orgs","repos_url":"https://api.github.com/users/jmburges/repos","events_url":"https://api.github.com/users/jmburges/events{/privacy}","received_events_url":"https://api.github.com/users/jmburges/received_events","type":"User","site_admin":false},"body":"This is pretty advanced. Do they know that you can access a string via array notation? Also why are you putting `'...'` in parenthesis? ","created_at":"2015-09-25T10:58:06Z","updated_at":"2015-09-25T10:58:06Z","html_url":"https://github.com/learn-co-curriculum/tweet-shortener/pull/5#discussion_r40418967","pull_request_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/comments/40418967"},"html":{"href":"https://github.com/learn-co-curriculum/tweet-shortener/pull/5#discussion_r40418967"},"pull_request":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/5","id":42471689,"html_url":"https://github.com/learn-co-curriculum/tweet-shortener/pull/5","diff_url":"https://github.com/learn-co-curriculum/tweet-shortener/pull/5.diff","patch_url":"https://github.com/learn-co-curriculum/tweet-shortener/pull/5.patch","issue_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues/5","number":5,"state":"open","locked":false,"title":"Wip tutorial","user":{"login":"deniznida","id":9004428,"avatar_url":"https://avatars.githubusercontent.com/u/9004428?v=3","gravatar_id":"","url":"https://api.github.com/users/deniznida","html_url":"https://github.com/deniznida","followers_url":"https://api.github.com/users/deniznida/followers","following_url":"https://api.github.com/users/deniznida/following{/other_user}","gists_url":"https://api.github.com/users/deniznida/gists{/gist_id}","starred_url":"https://api.github.com/users/deniznida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deniznida/subscriptions","organizations_url":"https://api.github.com/users/deniznida/orgs","repos_url":"https://api.github.com/users/deniznida/repos","events_url":"https://api.github.com/users/deniznida/events{/privacy}","received_events_url":"https://api.github.com/users/deniznida/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-14T16:10:22Z","updated_at":"2015-09-25T10:58:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c005084a250612b3dca3dae7e56ad5d6a12774a","assignee":{"login":"jmburges","id":58342,"avatar_url":"https://avatars.githubusercontent.com/u/58342?v=3","gravatar_id":"","url":"https://api.github.com/users/jmburges","html_url":"https://github.com/jmburges","followers_url":"https://api.github.com/users/jmburges/followers","following_url":"https://api.github.com/users/jmburges/following{/other_user}","gists_url":"https://api.github.com/users/jmburges/gists{/gist_id}","starred_url":"https://api.github.com/users/jmburges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmburges/subscriptions","organizations_url":"https://api.github.com/users/jmburges/orgs","repos_url":"https://api.github.com/users/jmburges/repos","events_url":"https://api.github.com/users/jmburges/events{/privacy}","received_events_url":"https://api.github.com/users/jmburges/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/5/commits","review_comments_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/5/comments","review_comment_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/comments{/number}","comments_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues/5/comments","statuses_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/statuses/798a64cf620492a841608fd59b3a10be149600a3","head":{"label":"learn-co-curriculum:wip-tutorial","ref":"wip-tutorial","sha":"798a64cf620492a841608fd59b3a10be149600a3","user":{"login":"learn-co-curriculum","id":6208017,"avatar_url":"https://avatars.githubusercontent.com/u/6208017?v=3","gravatar_id":"","url":"https://api.github.com/users/learn-co-curriculum","html_url":"https://github.com/learn-co-curriculum","followers_url":"https://api.github.com/users/learn-co-curriculum/followers","following_url":"https://api.github.com/users/learn-co-curriculum/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-curriculum/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-curriculum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-curriculum/subscriptions","organizations_url":"https://api.github.com/users/learn-co-curriculum/orgs","repos_url":"https://api.github.com/users/learn-co-curriculum/repos","events_url":"https://api.github.com/users/learn-co-curriculum/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-curriculum/received_events","type":"Organization","site_admin":false},"repo":{"id":15345800,"name":"tweet-shortener","full_name":"learn-co-curriculum/tweet-shortener","owner":{"login":"learn-co-curriculum","id":6208017,"avatar_url":"https://avatars.githubusercontent.com/u/6208017?v=3","gravatar_id":"","url":"https://api.github.com/users/learn-co-curriculum","html_url":"https://github.com/learn-co-curriculum","followers_url":"https://api.github.com/users/learn-co-curriculum/followers","following_url":"https://api.github.com/users/learn-co-curriculum/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-curriculum/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-curriculum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-curriculum/subscriptions","organizations_url":"https://api.github.com/users/learn-co-curriculum/orgs","repos_url":"https://api.github.com/users/learn-co-curriculum/repos","events_url":"https://api.github.com/users/learn-co-curriculum/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-curriculum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learn-co-curriculum/tweet-shortener","description":"Tweet Shortener lab","fork":false,"url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener","forks_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/forks","keys_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/teams","hooks_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/hooks","issue_events_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues/events{/number}","events_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/events","assignees_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/assignees{/user}","branches_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/branches{/branch}","tags_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/tags","blobs_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/refs{/sha}","trees_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/statuses/{sha}","languages_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/languages","stargazers_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/stargazers","contributors_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/contributors","subscribers_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/subscribers","subscription_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/subscription","commits_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/commits{/sha}","git_commits_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/commits{/sha}","comments_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/comments{/number}","issue_comment_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues/comments{/number}","contents_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/contents/{+path}","compare_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/merges","archive_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/downloads","issues_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues{/number}","pulls_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls{/number}","milestones_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/milestones{/number}","notifications_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/labels{/name}","releases_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/releases{/id}","created_at":"2013-12-20T18:51:42Z","updated_at":"2015-06-22T00:47:04Z","pushed_at":"2015-09-01T20:32:42Z","git_url":"git://github.com/learn-co-curriculum/tweet-shortener.git","ssh_url":"git@github.com:learn-co-curriculum/tweet-shortener.git","clone_url":"https://github.com/learn-co-curriculum/tweet-shortener.git","svn_url":"https://github.com/learn-co-curriculum/tweet-shortener","homepage":"flatironschool.com","size":359,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"learn-co-curriculum:solution","ref":"solution","sha":"2d04e46e42418e717ae18517dd4da3bcb756e1f8","user":{"login":"learn-co-curriculum","id":6208017,"avatar_url":"https://avatars.githubusercontent.com/u/6208017?v=3","gravatar_id":"","url":"https://api.github.com/users/learn-co-curriculum","html_url":"https://github.com/learn-co-curriculum","followers_url":"https://api.github.com/users/learn-co-curriculum/followers","following_url":"https://api.github.com/users/learn-co-curriculum/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-curriculum/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-curriculum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-curriculum/subscriptions","organizations_url":"https://api.github.com/users/learn-co-curriculum/orgs","repos_url":"https://api.github.com/users/learn-co-curriculum/repos","events_url":"https://api.github.com/users/learn-co-curriculum/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-curriculum/received_events","type":"Organization","site_admin":false},"repo":{"id":15345800,"name":"tweet-shortener","full_name":"learn-co-curriculum/tweet-shortener","owner":{"login":"learn-co-curriculum","id":6208017,"avatar_url":"https://avatars.githubusercontent.com/u/6208017?v=3","gravatar_id":"","url":"https://api.github.com/users/learn-co-curriculum","html_url":"https://github.com/learn-co-curriculum","followers_url":"https://api.github.com/users/learn-co-curriculum/followers","following_url":"https://api.github.com/users/learn-co-curriculum/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-curriculum/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-curriculum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-curriculum/subscriptions","organizations_url":"https://api.github.com/users/learn-co-curriculum/orgs","repos_url":"https://api.github.com/users/learn-co-curriculum/repos","events_url":"https://api.github.com/users/learn-co-curriculum/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-curriculum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learn-co-curriculum/tweet-shortener","description":"Tweet Shortener lab","fork":false,"url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener","forks_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/forks","keys_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/teams","hooks_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/hooks","issue_events_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues/events{/number}","events_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/events","assignees_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/assignees{/user}","branches_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/branches{/branch}","tags_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/tags","blobs_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/refs{/sha}","trees_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/statuses/{sha}","languages_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/languages","stargazers_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/stargazers","contributors_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/contributors","subscribers_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/subscribers","subscription_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/subscription","commits_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/commits{/sha}","git_commits_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/git/commits{/sha}","comments_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/comments{/number}","issue_comment_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues/comments{/number}","contents_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/contents/{+path}","compare_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/merges","archive_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/downloads","issues_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues{/number}","pulls_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls{/number}","milestones_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/milestones{/number}","notifications_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/labels{/name}","releases_url":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/releases{/id}","created_at":"2013-12-20T18:51:42Z","updated_at":"2015-06-22T00:47:04Z","pushed_at":"2015-09-01T20:32:42Z","git_url":"git://github.com/learn-co-curriculum/tweet-shortener.git","ssh_url":"git@github.com:learn-co-curriculum/tweet-shortener.git","clone_url":"https://github.com/learn-co-curriculum/tweet-shortener.git","svn_url":"https://github.com/learn-co-curriculum/tweet-shortener","homepage":"flatironschool.com","size":359,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/5"},"html":{"href":"https://github.com/learn-co-curriculum/tweet-shortener/pull/5"},"issue":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues/5"},"comments":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/learn-co-curriculum/tweet-shortener/statuses/798a64cf620492a841608fd59b3a10be149600a3"}}}}