{"action":"created","comment":{"url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/comments/47677526","id":47677526,"diff_hunk":"@@ -0,0 +1,40 @@\n+package ru.mipt.diht.students.nkarpachev.twitterstream;\n+\n+import twitter4j.Query;\n+import twitter4j.QueryResult;\n+import twitter4j.Status;\n+import twitter4j.Twitter;\n+import twitter4j.TwitterException;\n+import twitter4j.TwitterFactory;\n+\n+import java.util.List;\n+\n+public class SearchRunner {\n+\n+    public static void getTweetsByQuery(Query query, boolean doHideRetweets, int tweetLimit) {\n+        int printedTweets = 0;\n+        Twitter twitter = new TwitterFactory().getInstance();\n+        try {\n+            QueryResult result;\n+            do {\n+                result = twitter.search(query);\n+                List<Status> tweets = result.getTweets();\n+                for (Status tweet : tweets) {\n+                    if (printedTweets >= tweetLimit) {\n+                        break;\n+                    }\n+                    if (!doHideRetweets || !(tweet.isRetweet())) {\n+                        PrintTools.printTweet(tweet);\n+                        printedTweets++;\n+                    }\n+                }\n+                query = result.nextQuery();\n+            } while ((query != null) && (printedTweets < tweetLimit));\n+            System.exit(0);\n+        } catch (TwitterException te) {\n+            te.printStackTrace();\n+            System.out.println(\"Failed to search tweets: \" + te.getMessage());\n+            System.exit(-1);","path":"projects/nkarpachev/src/main/java/ru/mipt/diht/students/nkarpachev/twitterstream/SearchRunner.java","position":37,"original_position":37,"commit_id":"a9762cade6393ac715e73257a92bf5484984ee1e","original_commit_id":"a9762cade6393ac715e73257a92bf5484984ee1e","user":{"login":"Pitovsky","id":11497455,"avatar_url":"https://avatars.githubusercontent.com/u/11497455?v=3","gravatar_id":"","url":"https://api.github.com/users/Pitovsky","html_url":"https://github.com/Pitovsky","followers_url":"https://api.github.com/users/Pitovsky/followers","following_url":"https://api.github.com/users/Pitovsky/following{/other_user}","gists_url":"https://api.github.com/users/Pitovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Pitovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pitovsky/subscriptions","organizations_url":"https://api.github.com/users/Pitovsky/orgs","repos_url":"https://api.github.com/users/Pitovsky/repos","events_url":"https://api.github.com/users/Pitovsky/events{/privacy}","received_events_url":"https://api.github.com/users/Pitovsky/received_events","type":"User","site_admin":false},"body":"У нас по условию программа должна переподключаться в случае, когда соединение установить не получилось.","created_at":"2015-12-15T18:34:32Z","updated_at":"2015-12-15T18:34:32Z","html_url":"https://github.com/KhurtinDN/fizteh-java-2015/pull/48#discussion_r47677526","pull_request_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/comments/47677526"},"html":{"href":"https://github.com/KhurtinDN/fizteh-java-2015/pull/48#discussion_r47677526"},"pull_request":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/48","id":51470354,"html_url":"https://github.com/KhurtinDN/fizteh-java-2015/pull/48","diff_url":"https://github.com/KhurtinDN/fizteh-java-2015/pull/48.diff","patch_url":"https://github.com/KhurtinDN/fizteh-java-2015/pull/48.patch","issue_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/issues/48","number":48,"state":"open","locked":false,"title":"Карпачёв Николай, 496, TwitterStream","user":{"login":"nkarpachev","id":12223849,"avatar_url":"https://avatars.githubusercontent.com/u/12223849?v=3","gravatar_id":"","url":"https://api.github.com/users/nkarpachev","html_url":"https://github.com/nkarpachev","followers_url":"https://api.github.com/users/nkarpachev/followers","following_url":"https://api.github.com/users/nkarpachev/following{/other_user}","gists_url":"https://api.github.com/users/nkarpachev/gists{/gist_id}","starred_url":"https://api.github.com/users/nkarpachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkarpachev/subscriptions","organizations_url":"https://api.github.com/users/nkarpachev/orgs","repos_url":"https://api.github.com/users/nkarpachev/repos","events_url":"https://api.github.com/users/nkarpachev/events{/privacy}","received_events_url":"https://api.github.com/users/nkarpachev/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-22T18:04:38Z","updated_at":"2015-12-15T18:34:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6dcf9652df0054f2e976870afe146cf4ca863e5a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/48/commits","review_comments_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/48/comments","review_comment_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/issues/48/comments","statuses_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/statuses/a9762cade6393ac715e73257a92bf5484984ee1e","head":{"label":"nkarpachev:TwitterStream","ref":"TwitterStream","sha":"a9762cade6393ac715e73257a92bf5484984ee1e","user":{"login":"nkarpachev","id":12223849,"avatar_url":"https://avatars.githubusercontent.com/u/12223849?v=3","gravatar_id":"","url":"https://api.github.com/users/nkarpachev","html_url":"https://github.com/nkarpachev","followers_url":"https://api.github.com/users/nkarpachev/followers","following_url":"https://api.github.com/users/nkarpachev/following{/other_user}","gists_url":"https://api.github.com/users/nkarpachev/gists{/gist_id}","starred_url":"https://api.github.com/users/nkarpachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkarpachev/subscriptions","organizations_url":"https://api.github.com/users/nkarpachev/orgs","repos_url":"https://api.github.com/users/nkarpachev/repos","events_url":"https://api.github.com/users/nkarpachev/events{/privacy}","received_events_url":"https://api.github.com/users/nkarpachev/received_events","type":"User","site_admin":false},"repo":{"id":44195080,"name":"fizteh-java-2015","full_name":"nkarpachev/fizteh-java-2015","owner":{"login":"nkarpachev","id":12223849,"avatar_url":"https://avatars.githubusercontent.com/u/12223849?v=3","gravatar_id":"","url":"https://api.github.com/users/nkarpachev","html_url":"https://github.com/nkarpachev","followers_url":"https://api.github.com/users/nkarpachev/followers","following_url":"https://api.github.com/users/nkarpachev/following{/other_user}","gists_url":"https://api.github.com/users/nkarpachev/gists{/gist_id}","starred_url":"https://api.github.com/users/nkarpachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkarpachev/subscriptions","organizations_url":"https://api.github.com/users/nkarpachev/orgs","repos_url":"https://api.github.com/users/nkarpachev/repos","events_url":"https://api.github.com/users/nkarpachev/events{/privacy}","received_events_url":"https://api.github.com/users/nkarpachev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nkarpachev/fizteh-java-2015","description":"","fork":true,"url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015","forks_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/forks","keys_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/teams","hooks_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/hooks","issue_events_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/issues/events{/number}","events_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/events","assignees_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/assignees{/user}","branches_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/branches{/branch}","tags_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/tags","blobs_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/git/refs{/sha}","trees_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/statuses/{sha}","languages_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/languages","stargazers_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/stargazers","contributors_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/contributors","subscribers_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/subscribers","subscription_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/subscription","commits_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/commits{/sha}","git_commits_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/git/commits{/sha}","comments_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/comments{/number}","issue_comment_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/issues/comments{/number}","contents_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/contents/{+path}","compare_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/merges","archive_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/downloads","issues_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/issues{/number}","pulls_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/pulls{/number}","milestones_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/milestones{/number}","notifications_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/labels{/name}","releases_url":"https://api.github.com/repos/nkarpachev/fizteh-java-2015/releases{/id}","created_at":"2015-10-13T18:04:31Z","updated_at":"2015-10-13T18:04:32Z","pushed_at":"2015-12-15T17:03:03Z","git_url":"git://github.com/nkarpachev/fizteh-java-2015.git","ssh_url":"git@github.com:nkarpachev/fizteh-java-2015.git","clone_url":"https://github.com/nkarpachev/fizteh-java-2015.git","svn_url":"https://github.com/nkarpachev/fizteh-java-2015","homepage":null,"size":85,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"KhurtinDN:master","ref":"master","sha":"cb81bfc50d86c6fbd094039a1b3f683daa3cb26b","user":{"login":"KhurtinDN","id":320987,"avatar_url":"https://avatars.githubusercontent.com/u/320987?v=3","gravatar_id":"","url":"https://api.github.com/users/KhurtinDN","html_url":"https://github.com/KhurtinDN","followers_url":"https://api.github.com/users/KhurtinDN/followers","following_url":"https://api.github.com/users/KhurtinDN/following{/other_user}","gists_url":"https://api.github.com/users/KhurtinDN/gists{/gist_id}","starred_url":"https://api.github.com/users/KhurtinDN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhurtinDN/subscriptions","organizations_url":"https://api.github.com/users/KhurtinDN/orgs","repos_url":"https://api.github.com/users/KhurtinDN/repos","events_url":"https://api.github.com/users/KhurtinDN/events{/privacy}","received_events_url":"https://api.github.com/users/KhurtinDN/received_events","type":"User","site_admin":false},"repo":{"id":42640944,"name":"fizteh-java-2015","full_name":"KhurtinDN/fizteh-java-2015","owner":{"login":"KhurtinDN","id":320987,"avatar_url":"https://avatars.githubusercontent.com/u/320987?v=3","gravatar_id":"","url":"https://api.github.com/users/KhurtinDN","html_url":"https://github.com/KhurtinDN","followers_url":"https://api.github.com/users/KhurtinDN/followers","following_url":"https://api.github.com/users/KhurtinDN/following{/other_user}","gists_url":"https://api.github.com/users/KhurtinDN/gists{/gist_id}","starred_url":"https://api.github.com/users/KhurtinDN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhurtinDN/subscriptions","organizations_url":"https://api.github.com/users/KhurtinDN/orgs","repos_url":"https://api.github.com/users/KhurtinDN/repos","events_url":"https://api.github.com/users/KhurtinDN/events{/privacy}","received_events_url":"https://api.github.com/users/KhurtinDN/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KhurtinDN/fizteh-java-2015","description":"","fork":false,"url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015","forks_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/forks","keys_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/teams","hooks_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/hooks","issue_events_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/issues/events{/number}","events_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/events","assignees_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/assignees{/user}","branches_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/branches{/branch}","tags_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/tags","blobs_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/git/refs{/sha}","trees_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/statuses/{sha}","languages_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/languages","stargazers_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/stargazers","contributors_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/contributors","subscribers_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/subscribers","subscription_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/subscription","commits_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/commits{/sha}","git_commits_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/git/commits{/sha}","comments_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/comments{/number}","issue_comment_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/issues/comments{/number}","contents_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/contents/{+path}","compare_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/merges","archive_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/downloads","issues_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/issues{/number}","pulls_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls{/number}","milestones_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/milestones{/number}","notifications_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/labels{/name}","releases_url":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/releases{/id}","created_at":"2015-09-17T07:13:10Z","updated_at":"2015-11-24T22:02:16Z","pushed_at":"2015-12-15T17:03:03Z","git_url":"git://github.com/KhurtinDN/fizteh-java-2015.git","ssh_url":"git@github.com:KhurtinDN/fizteh-java-2015.git","clone_url":"https://github.com/KhurtinDN/fizteh-java-2015.git","svn_url":"https://github.com/KhurtinDN/fizteh-java-2015","homepage":null,"size":805,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":28,"forks":37,"open_issues":28,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/48"},"html":{"href":"https://github.com/KhurtinDN/fizteh-java-2015/pull/48"},"issue":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/issues/48"},"comments":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/KhurtinDN/fizteh-java-2015/statuses/a9762cade6393ac715e73257a92bf5484984ee1e"}}}}