diff --git a/.gitignore b/.gitignore index 216927c6..e795f3d9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,3 @@ workbench.xmi *.swp .settings .checkstyle -twitter4j.properties diff --git a/akormushin/pom.xml b/akormushin/pom.xml index 8bd0f0dc..96d9a2e6 100644 --- a/akormushin/pom.xml +++ b/akormushin/pom.xml @@ -23,13 +23,6 @@ jcommander 1.48 - - - commons-io - commons-io - 2.4 - test - diff --git a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/annotations/xml/Group.java b/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/annotations/xml/Group.java index facb2fae..1b8ef32a 100644 --- a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/annotations/xml/Group.java +++ b/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/annotations/xml/Group.java @@ -5,8 +5,6 @@ import java.util.Arrays; import java.util.List; -import static java.util.stream.Collectors.toCollection; - /** * Created by kormushin on 22.09.15. */ @@ -14,7 +12,7 @@ @XmlType @XmlAccessorType(XmlAccessType.FIELD) @DatabaseTable -public class Group implements Cloneable { +public class Group { @PrimaryKey @XmlAttribute @@ -55,16 +53,4 @@ public String toString() { + '}'; } - @Override - public Group clone() { - try { - Group clone = (Group) super.clone(); - clone.setStudents(students.stream() - .map(Student::clone) - .collect(toCollection(ArrayList::new))); - return clone; - } catch (CloneNotSupportedException e) { - throw new IllegalStateException(e); - } - } } diff --git a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/annotations/xml/Student.java b/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/annotations/xml/Student.java index 68060ab9..7ed534b7 100644 --- a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/annotations/xml/Student.java +++ b/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/annotations/xml/Student.java @@ -8,7 +8,7 @@ @XmlRootElement @XmlType @XmlAccessorType(XmlAccessType.FIELD) -public class Student implements Cloneable { +public class Student { @XmlAttribute private String firstName; @@ -47,13 +47,4 @@ public String toString() { + ", secondName='" + getSecondName() + '\'' + '}'; } - - @Override - public Student clone() { - try { - return (Student) super.clone(); - } catch (CloneNotSupportedException e) { - throw new IllegalStateException(e); - } - } } diff --git a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/Main.java b/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/Main.java deleted file mode 100644 index 1a060b95..00000000 --- a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/Main.java +++ /dev/null @@ -1,39 +0,0 @@ -package ru.fizteh.fivt.students.akormushin.moduletests; - -import ru.fizteh.fivt.students.akormushin.moduletests.library.TwitterService; -import ru.fizteh.fivt.students.akormushin.moduletests.library.TwitterServiceImpl; -import twitter4j.TwitterException; -import twitter4j.TwitterFactory; -import twitter4j.TwitterStreamFactory; - -/** - * Kind of manual test - *

- * Created by kormushin on 29.09.15. - */ -public class Main { - - public static void main(String[] args) { - if (args.length != 1) { - System.out.println("Неверные параметры. Нужно: Main "); - System.exit(1); - } - - TwitterService twitterService = - new TwitterServiceImpl(TwitterFactory.getSingleton(), TwitterStreamFactory.getSingleton()); - try { - System.out.println("Query result:"); - twitterService.getFormattedTweets(args[0]) - .forEach(System.out::println); - - System.out.println(); - System.out.println("And new ones with streaming:"); - twitterService.listenForTweets(args[0], System.out::println); - } catch (TwitterException e) { - System.out.println("Ошибка при получении твитов."); - - e.printStackTrace(); - System.exit(1); - } - } -} diff --git a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterService.java b/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterService.java deleted file mode 100644 index b2c4a40c..00000000 --- a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterService.java +++ /dev/null @@ -1,15 +0,0 @@ -package ru.fizteh.fivt.students.akormushin.moduletests.library; - -import twitter4j.TwitterException; - -import java.util.List; -import java.util.function.Consumer; - -/** - * Created by kormushin on 30.09.15. - */ -public interface TwitterService { - List getFormattedTweets(String query) throws TwitterException; - - void listenForTweets(String query, Consumer listener); -} diff --git a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterServiceImpl.java b/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterServiceImpl.java deleted file mode 100644 index 88aff6fd..00000000 --- a/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package ru.fizteh.fivt.students.akormushin.moduletests.library; - -import twitter4j.*; - -import java.util.List; -import java.util.function.Consumer; - -import static java.util.stream.Collectors.toList; - -/** - * Created by kormushin on 29.09.15. - */ -public class TwitterServiceImpl implements TwitterService { - - private final Twitter twitter; - private final TwitterStream twitterStream; - - /** - * All dependency classes are passed via constructor to decouple them and let us mock them. - * - * @param twitter - * @param twitterStream - */ - public TwitterServiceImpl(Twitter twitter, TwitterStream twitterStream) { - this.twitter = twitter; - this.twitterStream = twitterStream; - } - - /** - * @param query - * @return - * @throws TwitterException - */ - @Override - public List getFormattedTweets(String query) throws TwitterException { - if (query == null) { - throw new IllegalArgumentException("Query is required"); - } - - return twitter - .search(new Query(query)).getTweets().stream() - .map(this::formatTweet) - .collect(toList()); - } - - /** - * @param query - * @param listener - */ - @Override - public void listenForTweets(String query, Consumer listener) { - twitterStream.addListener(new StatusAdapter() { - @Override - public void onStatus(Status status) { - listener.accept(formatTweet(status)); - } - - @Override - public void onException(Exception ex) { - ex.printStackTrace(); - } - }); - twitterStream.filter(new FilterQuery().track(query)); - } - - /** - * You shouldn't test private methods separately. It will be covered by public methods that use him. - * - * @param status - * @return - */ - private String formatTweet(Status status) { - return "@" + status.getUser().getScreenName() + ": " + status.getText(); - } -} diff --git a/akormushin/src/main/resources/log4j.properties b/akormushin/src/main/resources/log4j.properties deleted file mode 100644 index 1bf88a42..00000000 --- a/akormushin/src/main/resources/log4j.properties +++ /dev/null @@ -1,3 +0,0 @@ -#log4j.rootLogger=noop - -#log4j.appender.noop = org.apache.log4j.spi.NOPLogger diff --git a/akormushin/src/test/java/ru/fizteh/fivt/students/akormushin/annotations/junit/GroupStatisticsTest.java b/akormushin/src/test/java/ru/fizteh/fivt/students/akormushin/annotations/junit/GroupStatisticsTest.java index efd7d92c..0f0934e4 100644 --- a/akormushin/src/test/java/ru/fizteh/fivt/students/akormushin/annotations/junit/GroupStatisticsTest.java +++ b/akormushin/src/test/java/ru/fizteh/fivt/students/akormushin/annotations/junit/GroupStatisticsTest.java @@ -1,71 +1,34 @@ package ru.fizteh.fivt.students.akormushin.annotations.junit; -import org.junit.After; +import junit.framework.TestCase; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; -import ru.fizteh.fivt.students.akormushin.annotations.xml.Group; -import ru.fizteh.fivt.students.akormushin.annotations.xml.Student; -import java.util.ArrayList; -import java.util.Arrays; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.when; +import java.security.acl.Group; /** * Created by kormushin on 22.09.15. */ @RunWith(MockitoJUnitRunner.class) -public class GroupStatisticsTest { +public class GroupStatisticsTest extends TestCase { @InjectMocks private GroupStatistics groupStatistics; @Mock - private Database database;// = mock(Database.class); - - @BeforeClass - public static void beforeAll() { - System.out.println("before all"); - } + private Database database; @Before - public void setUp1() throws IllegalAccessException { - Student student1 = new Student("Ivan", "Ivanov"); - Student student2 = new Student("Petr", "Petrov"); + public void setUp(){ - Group group1 = new Group("494", student1, student2); - Group group2 = new Group("495", student1, student2); - - when(database.select()).thenReturn(Arrays.asList(group1, group2)); - when(database.select(anyObject())).thenReturn(group1); - when(database.select(any())).thenAnswer(i -> { - if (i.getArguments()[0].equals("494")) { - return group1; - } - return null; - }); } - @After - public void afterTest() { - System.out.println("after test"); - } - - @Test public void testGetStudentsByGroup() throws Exception { - assertThat(groupStatistics.getStudentsByGroup().get("494"), is(2)); - - assertThat(groupStatistics.getStudentsByGroup().get("495"), is(2)); + System.out.println(groupStatistics.getStudentsByGroup()); } - } \ No newline at end of file diff --git a/akormushin/src/test/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterServiceImplTest.java b/akormushin/src/test/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterServiceImplTest.java deleted file mode 100644 index c5d1987c..00000000 --- a/akormushin/src/test/java/ru/fizteh/fivt/students/akormushin/moduletests/library/TwitterServiceImplTest.java +++ /dev/null @@ -1,122 +0,0 @@ -package ru.fizteh.fivt.students.akormushin.moduletests.library; - -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import ru.fizteh.fivt.students.akormushin.moduletests.library.TwitterServiceImpl; -import twitter4j.*; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.argThat; -import static org.mockito.Mockito.*; - -/** - * Example unit tests for tweets retrieval service with mocking - *

- * Created by kormushin on 29.09.15. - */ -@RunWith(MockitoJUnitRunner.class) -public class TwitterServiceImplTest { - - @Mock - private Twitter twitter; - - @Mock - private TwitterStream twitterStream; - - /** - * Mockito calls

new TwitterServiceImpl(twitter, twitterStream)
here - */ - @InjectMocks - private TwitterServiceImpl twitterService; - - public static List statuses; - - @BeforeClass - public static void loadSampleData() { - statuses = Twitter4jTestUtils.tweetsFromJson("/search-java-response.json"); - } - - /** - * Preparing sample data for test. Initializing mocks - * - * @throws Exception - */ - @Before - public void setUp() throws Exception { - QueryResult queryResult = mock(QueryResult.class); - when(queryResult.getTweets()).thenReturn(statuses); - - when(twitter.search(argThat(hasProperty("query", equalTo("java"))))) - .thenReturn(queryResult); - - QueryResult emptyQueryResult = mock(QueryResult.class); - when(emptyQueryResult.getTweets()).thenReturn(Collections.emptyList()); - - when(twitter.search(argThat(hasProperty("query", not(equalTo("java")))))) - .thenReturn(emptyQueryResult); - } - - @Test - public void testGetFormattedTweets() throws Exception { - List tweets = twitterService.getFormattedTweets("java"); - - assertThat(tweets, hasSize(15)); - assertThat(tweets, hasItems( - "@lxwalls: RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "@Ankit__Tomar: #Hiring Java Lead Developer - Click here for job details : http://t.co/0slLn3YVTW" - )); - - verify(twitter).search(argThat(hasProperty("query", equalTo("java")))); - } - - @Test - public void testGetFormattedTweets_empty_result() throws Exception { - List tweets = twitterService.getFormattedTweets("c#"); - - assertThat(tweets, hasSize(0)); - - verify(twitter).search(argThat(hasProperty("query", equalTo("c#")))); - } - - @Test(expected = IllegalArgumentException.class) - public void testGetFormattedTweets_null_query() throws Exception { - twitterService.getFormattedTweets(null); - } - - @Test - public void testListenForTweets() throws Exception { - //Use ArgumentCaptor to remember argument between different stub invocations - ArgumentCaptor statusListener = ArgumentCaptor.forClass(StatusListener.class); - //Mocking void method - doNothing().when(twitterStream).addListener((StatusListener) statusListener.capture()); - doAnswer(i -> { - statuses.forEach(s -> statusListener.getValue().onStatus(s)); - return null; - }).when(twitterStream).filter(any(FilterQuery.class)); - - List tweets = new ArrayList<>(); - - twitterService.listenForTweets("java", tweets::add); - - assertThat(tweets, hasSize(15)); - assertThat(tweets, hasItems( - "@lxwalls: RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "@Ankit__Tomar: #Hiring Java Lead Developer - Click here for job details : http://t.co/0slLn3YVTW" - )); - - verify(twitterStream).addListener((StatusListener) any(StatusAdapter.class)); - verify(twitterStream).filter(any(FilterQuery.class)); - } -} \ No newline at end of file diff --git a/akormushin/src/test/java/twitter4j/Twitter4jTestUtils.java b/akormushin/src/test/java/twitter4j/Twitter4jTestUtils.java deleted file mode 100644 index 884ee210..00000000 --- a/akormushin/src/test/java/twitter4j/Twitter4jTestUtils.java +++ /dev/null @@ -1,33 +0,0 @@ -package twitter4j; - -import org.apache.commons.io.IOUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * Dirty hack to access twitter4j package local classes. - *

- * Created by kormushin on 29.09.15. - */ -public class Twitter4jTestUtils { - - public static List tweetsFromJson(String resource) { - try (InputStream inputStream = Twitter4jTestUtils.class.getResourceAsStream(resource)) { - JSONObject json = new JSONObject(IOUtils.toString(inputStream)); - - JSONArray array = json.getJSONArray("statuses"); - List tweets = new ArrayList<>(array.length()); - for (int i = 0; i < array.length(); i++) { - JSONObject tweet = array.getJSONObject(i); - tweets.add(new StatusJSONImpl(tweet)); - } - - return tweets; - } catch (IOException | JSONException | TwitterException e) { - throw new RuntimeException(e); - } - } -} diff --git a/akormushin/src/test/resources/search-java-response.json b/akormushin/src/test/resources/search-java-response.json deleted file mode 100644 index 5d0164fc..00000000 --- a/akormushin/src/test/resources/search-java-response.json +++ /dev/null @@ -1,2740 +0,0 @@ -{ - "search_metadata": { - "completed_in": 0.031, - "count": 15, - "max_id": 648945747530924033, - "max_id_str": "648945747530924033", - "next_results": "?max_id=648945609307615231&q=java&include_entities=1", - "query": "java", - "refresh_url": "?since_id=648945747530924033&q=java&include_entities=1", - "since_id": 0, - "since_id_str": "0" - }, - "statuses": [ - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:37 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 56, - 74 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 76, - 98 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 99, - 121 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [{ - "id": 1451773004, - "id_str": "1451773004", - "indices": [ - 3, - 17 - ], - "name": "Intl. Space Station", - "screen_name": "Space_Station" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945747530924033, - "id_str": "648945747530924033", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 53, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:38:30 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 37, - 55 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 57, - 79 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 80, - 102 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [] - }, - "favorite_count": 52, - "favorited": false, - "geo": null, - "id": 648944962713878528, - "id_str": "648944962713878528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 53, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 23 15:25:28 +0000 2013", - "default_profile": false, - "default_profile_image": false, - "description": "NASA's page for updates from the International Space Station, the world-class lab orbiting Earth 250 miles above. For the latest research, follow @ISS_Research.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "nasa.gov/station", - "expanded_url": "http://www.nasa.gov/station", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/9Gk2GZYDsP" - }]} - }, - "favourites_count": 1161, - "follow_request_sent": false, - "followers_count": 281874, - "following": false, - "friends_count": 229, - "geo_enabled": false, - "has_extended_profile": false, - "id": 1451773004, - "id_str": "1451773004", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3474, - "location": "Low Earth Orbit", - "name": "Intl. Space Station", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1451773004/1434028060", - "profile_image_url": "http://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "Space_Station", - "statuses_count": 3110, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/9Gk2GZYDsP", - "utc_offset": -18000, - "verified": true - } - }, - "source": "Twitter Web Client<\/a>", - "text": "RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Wed Mar 03 02:42:28 +0000 2010", - "default_profile": false, - "default_profile_image": false, - "description": "Freelancer, drifter, occasional poet, sometime book reviewer. My opinions are my own and definitely not those of the Hive Mind.", - "entities": {"description": {"urls": []}}, - "favourites_count": 317, - "follow_request_sent": false, - "followers_count": 386, - "following": false, - "friends_count": 655, - "geo_enabled": true, - "has_extended_profile": false, - "id": 119247132, - "id_str": "119247132", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 17, - "location": "", - "name": "Alex Walls", - "notifications": false, - "profile_background_color": "ACDED6", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme18/bg.gif", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme18/bg.gif", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/119247132/1406185638", - "profile_image_url": "http://pbs.twimg.com/profile_images/591133017084538880/R3TvUHZ__normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/591133017084538880/R3TvUHZ__normal.jpg", - "profile_link_color": "038543", - "profile_sidebar_border_color": "EEEEEE", - "profile_sidebar_fill_color": "F6F6F6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "lxwalls", - "statuses_count": 5078, - "time_zone": "Wellington", - "url": null, - "utc_offset": 46800, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:34 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 0, - 7 - ], - "text": "Hiring" - }], - "symbols": [], - "urls": [{ - "display_url": "techfetch.com/JS/JS_view_job\u2026", - "expanded_url": "http://www.techfetch.com/JS/JS_view_job.aspx?js=2840002", - "indices": [ - 59, - 81 - ], - "url": "http://t.co/0slLn3YVTW" - }], - "user_mentions": [] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945732205023232, - "id_str": "648945732205023232", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 0, - "retweeted": false, - "source": "TechFetch.com<\/a>", - "text": "#Hiring Java Lead Developer - Click here for job details : http://t.co/0slLn3YVTW", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Wed Oct 07 16:26:23 +0000 2009", - "default_profile": false, - "default_profile_image": false, - "description": "", - "entities": {"description": {"urls": []}}, - "favourites_count": 9, - "follow_request_sent": false, - "followers_count": 67, - "following": false, - "friends_count": 821, - "geo_enabled": true, - "has_extended_profile": true, - "id": 80614847, - "id_str": "80614847", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 4, - "location": "San Jose, CA", - "name": "Ankit Tomar", - "notifications": false, - "profile_background_color": "000000", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme10/bg.gif", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme10/bg.gif", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/80614847/1353177973", - "profile_image_url": "http://pbs.twimg.com/profile_images/2861537783/4b15ad7da51a7882f16fdbf16767131b_normal.jpeg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/2861537783/4b15ad7da51a7882f16fdbf16767131b_normal.jpeg", - "profile_link_color": "FA743E", - "profile_sidebar_border_color": "000000", - "profile_sidebar_fill_color": "000000", - "profile_text_color": "000000", - "profile_use_background_image": false, - "protected": false, - "screen_name": "Ankit__Tomar", - "statuses_count": 165, - "time_zone": "New Delhi", - "url": null, - "utc_offset": 19800, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:32 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 56, - 74 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 76, - 98 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 99, - 121 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [{ - "id": 1451773004, - "id_str": "1451773004", - "indices": [ - 3, - 17 - ], - "name": "Intl. Space Station", - "screen_name": "Space_Station" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945725640962048, - "id_str": "648945725640962048", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 53, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:38:30 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 37, - 55 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 57, - 79 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 80, - 102 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [] - }, - "favorite_count": 52, - "favorited": false, - "geo": null, - "id": 648944962713878528, - "id_str": "648944962713878528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 53, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 23 15:25:28 +0000 2013", - "default_profile": false, - "default_profile_image": false, - "description": "NASA's page for updates from the International Space Station, the world-class lab orbiting Earth 250 miles above. For the latest research, follow @ISS_Research.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "nasa.gov/station", - "expanded_url": "http://www.nasa.gov/station", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/9Gk2GZYDsP" - }]} - }, - "favourites_count": 1161, - "follow_request_sent": false, - "followers_count": 281874, - "following": false, - "friends_count": 229, - "geo_enabled": false, - "has_extended_profile": false, - "id": 1451773004, - "id_str": "1451773004", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3474, - "location": "Low Earth Orbit", - "name": "Intl. Space Station", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1451773004/1434028060", - "profile_image_url": "http://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "Space_Station", - "statuses_count": 3110, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/9Gk2GZYDsP", - "utc_offset": -18000, - "verified": true - } - }, - "source": "twicca<\/a>", - "text": "RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 21 23:34:35 +0000 2009", - "default_profile": false, - "default_profile_image": false, - "description": "(aka Yurado/The Mind) Inmortal... →", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "about.me/yurado", - "expanded_url": "http://about.me/yurado", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/h812amM7uj" - }]} - }, - "favourites_count": 555, - "follow_request_sent": false, - "followers_count": 1353, - "following": false, - "friends_count": 1357, - "geo_enabled": true, - "has_extended_profile": true, - "id": 41702532, - "id_str": "41702532", - "is_translation_enabled": false, - "is_translator": false, - "lang": "es", - "listed_count": 14, - "location": "Bulnes, Chile", - "name": "ライオット・イン・ラゴス", - "notifications": false, - "profile_background_color": "8B542B", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/53741136/greenbackgroundA.jpg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/53741136/greenbackgroundA.jpg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/41702532/1349926347", - "profile_image_url": "http://pbs.twimg.com/profile_images/634018808819286016/IbzlRzif_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/634018808819286016/IbzlRzif_normal.jpg", - "profile_link_color": "9D582E", - "profile_sidebar_border_color": "D9B17E", - "profile_sidebar_fill_color": "EADEAA", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "ElYurado", - "statuses_count": 24722, - "time_zone": "Santiago", - "url": "http://t.co/h812amM7uj", - "utc_offset": -10800, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:32 +0000 2015", - "entities": { - "hashtags": [], - "media": [{ - "display_url": "pic.twitter.com/XYjX1C98ae", - "expanded_url": "http://twitter.com/gomezbartolomeg/status/648945723933884416/photo/1", - "id": 648945723824844802, - "id_str": "648945723824844802", - "indices": [ - 95, - 117 - ], - "media_url": "http://pbs.twimg.com/media/CQGEspMWsAIoZVp.jpg", - "media_url_https": "https://pbs.twimg.com/media/CQGEspMWsAIoZVp.jpg", - "sizes": { - "large": { - "h": 300, - "resize": "fit", - "w": 238 - }, - "medium": { - "h": 300, - "resize": "fit", - "w": 238 - }, - "small": { - "h": 300, - "resize": "fit", - "w": 238 - }, - "thumb": { - "h": 150, - "resize": "crop", - "w": 150 - } - }, - "type": "photo", - "url": "http://t.co/XYjX1C98ae" - }], - "symbols": [], - "urls": [], - "user_mentions": [] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945723933884416, - "id_str": "648945723933884416", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 0, - "retweeted": false, - "source": "IFTTT<\/a>", - "text": "The Java(TM) Developers Almanac 2000 (3rd Edition) by Chan, Patrick, Rosanna Le [link removed] http://t.co/XYjX1C98ae", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Sat Feb 14 20:55:22 +0000 2015", - "default_profile": true, - "default_profile_image": false, - "description": "pompous offer", - "entities": {"description": {"urls": []}}, - "favourites_count": 0, - "follow_request_sent": false, - "followers_count": 62, - "following": false, - "friends_count": 40, - "geo_enabled": false, - "has_extended_profile": false, - "id": 3020129600, - "id_str": "3020129600", - "is_translation_enabled": false, - "is_translator": false, - "lang": "es", - "listed_count": 16, - "location": "", - "name": "pompous offer", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/3020129600/1423947428", - "profile_image_url": "http://pbs.twimg.com/profile_images/566702665376096256/1pBzDk6I_normal.jpeg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/566702665376096256/1pBzDk6I_normal.jpeg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "C0DEED", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "gomezbartolomeg", - "statuses_count": 68215, - "time_zone": null, - "url": null, - "utc_offset": null, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:31 +0000 2015", - "entities": { - "hashtags": [ - { - "indices": [ - 14, - 21 - ], - "text": "Oracle" - }, - { - "indices": [ - 95, - 100 - ], - "text": "jobs" - } - ], - "symbols": [], - "urls": [{ - "display_url": "neuvoo.com/job.php?id=8n6\u2026", - "expanded_url": "http://neuvoo.com/job.php?id=8n62u4c8a7&source=twitter&lang=en&client_id=224&l=Albany%2C+New+York%2C+US&k=Oracle+%2F+PL-SQL+Microsoft+Visual+Studio+WCF+.Net+Programmer-Ajax+%2F+Java+Script", - "indices": [ - 101, - 123 - ], - "url": "http://t.co/ly0uLOAvvi" - }], - "user_mentions": [] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945722742730752, - "id_str": "648945722742730752", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 0, - "retweeted": false, - "source": "seed.mytweetsys.app.t00<\/a>", - "text": "Looking for a #Oracle #/ PL-SQL Microsoft Visual Studio WCF .Net Programmer-Ajax / Java Script #jobs http://t.co/ly0uLOAvvi", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Wed Jan 21 20:54:25 +0000 2015", - "default_profile": true, - "default_profile_image": false, - "description": "Looking for a job in Albany? Check out our website http://t.co/tC4rdh1XtB", - "entities": { - "description": {"urls": [{ - "display_url": "neuvoo.com/jobs/?k=&l=Alb\u2026", - "expanded_url": "http://neuvoo.com/jobs/?k=&l=Albany%2C+New+York&r=15", - "indices": [ - 53, - 75 - ], - "url": "http://t.co/tC4rdh1XtB" - }]}, - "url": {"urls": [{ - "display_url": "neuvoo.com/jobs/?k=&l=Alb\u2026", - "expanded_url": "http://neuvoo.com/jobs/?k=&l=Albany%2C+New+York&r=15", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/tC4rdh1XtB" - }]} - }, - "favourites_count": 0, - "follow_request_sent": false, - "followers_count": 981, - "following": false, - "friends_count": 1118, - "geo_enabled": false, - "has_extended_profile": false, - "id": 2990565875, - "id_str": "2990565875", - "is_translation_enabled": false, - "is_translator": false, - "lang": "fr", - "listed_count": 230, - "location": "Albany, New York", - "name": "Jobs Albany", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/2990565875/1421873907", - "profile_image_url": "http://pbs.twimg.com/profile_images/558004909434359809/QA_BZDPj_normal.png", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/558004909434359809/QA_BZDPj_normal.png", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "C0DEED", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "NeuvooAlbanyNY", - "statuses_count": 20382, - "time_zone": null, - "url": "http://t.co/tC4rdh1XtB", - "utc_offset": null, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:22 +0000 2015", - "entities": { - "hashtags": [], - "symbols": [], - "urls": [], - "user_mentions": [{ - "id": 106234268, - "id_str": "106234268", - "indices": [ - 3, - 19 - ], - "name": "Matthew Green", - "screen_name": "matthew_d_green" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945685744762880, - "id_str": "648945685744762880", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "retweet_count": 39, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Wed Jul 15 03:50:32 +0000 2015", - "entities": { - "hashtags": [], - "symbols": [], - "urls": [], - "user_mentions": [] - }, - "favorite_count": 36, - "favorited": false, - "geo": null, - "id": 621164918914592768, - "id_str": "621164918914592768", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "retweet_count": 39, - "retweeted": false, - "source": "Twitter for iPhone<\/a>", - "text": "As bad as F5 crypto is, it's not as bad as Java crypto -- which appears to have been created on a dare.", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Mon Jan 18 22:45:09 +0000 2010", - "default_profile": true, - "default_profile_image": false, - "description": "I teach cryptography at Johns Hopkins.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "blog.cryptographyengineering.com", - "expanded_url": "http://blog.cryptographyengineering.com", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/DGeUTzbDUe" - }]} - }, - "favourites_count": 6220, - "follow_request_sent": false, - "followers_count": 28439, - "following": false, - "friends_count": 418, - "geo_enabled": false, - "has_extended_profile": false, - "id": 106234268, - "id_str": "106234268", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 1256, - "location": "Baltimore, MD", - "name": "Matthew Green", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/106234268/1399054297", - "profile_image_url": "http://pbs.twimg.com/profile_images/2070934284/image_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/2070934284/image_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "C0DEED", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "matthew_d_green", - "statuses_count": 23739, - "time_zone": "Eastern Time (US & Canada)", - "url": "http://t.co/DGeUTzbDUe", - "utc_offset": -14400, - "verified": false - } - }, - "source": "Twidere for Android #3<\/a>", - "text": "RT @matthew_d_green: As bad as F5 crypto is, it's not as bad as Java crypto -- which appears to have been created on a dare.", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Tue Mar 10 00:02:52 +0000 2015", - "default_profile": false, - "default_profile_image": false, - "description": "", - "entities": {"description": {"urls": []}}, - "favourites_count": 2059, - "follow_request_sent": false, - "followers_count": 22, - "following": false, - "friends_count": 69, - "geo_enabled": false, - "has_extended_profile": false, - "id": 3082780575, - "id_str": "3082780575", - "is_translation_enabled": true, - "is_translator": false, - "lang": "en", - "listed_count": 22, - "location": "", - "name": "0xDEADBEEF", - "notifications": false, - "profile_background_color": "131516", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme14/bg.gif", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme14/bg.gif", - "profile_background_tile": true, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/3082780575/1429733813", - "profile_image_url": "http://pbs.twimg.com/profile_images/590978318935162880/Nr2UWCz8_normal.png", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/590978318935162880/Nr2UWCz8_normal.png", - "profile_link_color": "009999", - "profile_sidebar_border_color": "EEEEEE", - "profile_sidebar_fill_color": "EFEFEF", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "_dead_beef_", - "statuses_count": 2045, - "time_zone": "Belgrade", - "url": null, - "utc_offset": 7200, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:22 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 56, - 74 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 76, - 98 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 99, - 121 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [{ - "id": 1451773004, - "id_str": "1451773004", - "indices": [ - 3, - 17 - ], - "name": "Intl. Space Station", - "screen_name": "Space_Station" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945685430038528, - "id_str": "648945685430038528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 53, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:38:30 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 37, - 55 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 57, - 79 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 80, - 102 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [] - }, - "favorite_count": 52, - "favorited": false, - "geo": null, - "id": 648944962713878528, - "id_str": "648944962713878528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 53, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 23 15:25:28 +0000 2013", - "default_profile": false, - "default_profile_image": false, - "description": "NASA's page for updates from the International Space Station, the world-class lab orbiting Earth 250 miles above. For the latest research, follow @ISS_Research.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "nasa.gov/station", - "expanded_url": "http://www.nasa.gov/station", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/9Gk2GZYDsP" - }]} - }, - "favourites_count": 1161, - "follow_request_sent": false, - "followers_count": 281874, - "following": false, - "friends_count": 229, - "geo_enabled": false, - "has_extended_profile": false, - "id": 1451773004, - "id_str": "1451773004", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3474, - "location": "Low Earth Orbit", - "name": "Intl. Space Station", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1451773004/1434028060", - "profile_image_url": "http://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "Space_Station", - "statuses_count": 3110, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/9Gk2GZYDsP", - "utc_offset": -18000, - "verified": true - } - }, - "source": "Twitter for Android<\/a>", - "text": "RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Mon Jun 25 09:20:33 +0000 2012", - "default_profile": false, - "default_profile_image": false, - "description": "''We rest together, and then we run together. I think this is why we call our fans our friends. Because we breathe together.''", - "entities": {"description": {"urls": []}}, - "favourites_count": 5023, - "follow_request_sent": false, - "followers_count": 297, - "following": false, - "friends_count": 474, - "geo_enabled": true, - "has_extended_profile": false, - "id": 617942989, - "id_str": "617942989", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3, - "location": "primadonna, exo-l, lu fan", - "name": "brandnewsekai", - "notifications": false, - "profile_background_color": "1A1A1A", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/378800000122415797/7d200e893b948deb0705deae914cc301.png", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/378800000122415797/7d200e893b948deb0705deae914cc301.png", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/617942989/1433872609", - "profile_image_url": "http://pbs.twimg.com/profile_images/561606455363510272/tmgT-tHv_normal.jpeg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/561606455363510272/tmgT-tHv_normal.jpeg", - "profile_link_color": "D8C7E0", - "profile_sidebar_border_color": "000000", - "profile_sidebar_fill_color": "CEDBD7", - "profile_text_color": "8C9C43", - "profile_use_background_image": true, - "protected": false, - "screen_name": "bleckchocole", - "statuses_count": 20595, - "time_zone": "Beijing", - "url": null, - "utc_offset": 28800, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:19 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 56, - 74 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 76, - 98 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 99, - 121 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [{ - "id": 1451773004, - "id_str": "1451773004", - "indices": [ - 3, - 17 - ], - "name": "Intl. Space Station", - "screen_name": "Space_Station" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945669814775808, - "id_str": "648945669814775808", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 51, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:38:30 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 37, - 55 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 57, - 79 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 80, - 102 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [] - }, - "favorite_count": 50, - "favorited": false, - "geo": null, - "id": 648944962713878528, - "id_str": "648944962713878528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 51, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 23 15:25:28 +0000 2013", - "default_profile": false, - "default_profile_image": false, - "description": "NASA's page for updates from the International Space Station, the world-class lab orbiting Earth 250 miles above. For the latest research, follow @ISS_Research.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "nasa.gov/station", - "expanded_url": "http://www.nasa.gov/station", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/9Gk2GZYDsP" - }]} - }, - "favourites_count": 1161, - "follow_request_sent": false, - "followers_count": 281874, - "following": false, - "friends_count": 229, - "geo_enabled": false, - "has_extended_profile": false, - "id": 1451773004, - "id_str": "1451773004", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3474, - "location": "Low Earth Orbit", - "name": "Intl. Space Station", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1451773004/1434028060", - "profile_image_url": "http://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "Space_Station", - "statuses_count": 3110, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/9Gk2GZYDsP", - "utc_offset": -18000, - "verified": true - } - }, - "source": "Twitter for Android<\/a>", - "text": "RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Wed Mar 20 04:40:10 +0000 2013", - "default_profile": true, - "default_profile_image": false, - "description": "", - "entities": {"description": {"urls": []}}, - "favourites_count": 63286, - "follow_request_sent": false, - "followers_count": 902, - "following": false, - "friends_count": 2001, - "geo_enabled": true, - "has_extended_profile": false, - "id": 1282292556, - "id_str": "1282292556", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 14, - "location": "", - "name": "Larina", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1282292556/1381348772", - "profile_image_url": "http://pbs.twimg.com/profile_images/378800000572653729/eba3a5391fee331a49de4cb7ce81a78d_normal.jpeg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/378800000572653729/eba3a5391fee331a49de4cb7ce81a78d_normal.jpeg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "C0DEED", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "roni334458", - "statuses_count": 28054, - "time_zone": null, - "url": null, - "utc_offset": null, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:18 +0000 2015", - "entities": { - "hashtags": [ - { - "indices": [ - 90, - 98 - ], - "text": "Ireland" - }, - { - "indices": [ - 99, - 106 - ], - "text": "techie" - } - ], - "media": [{ - "display_url": "pic.twitter.com/WZfLORunxv", - "expanded_url": "http://twitter.com/ZazenAcademy/status/648945666773917696/photo/1", - "id": 648945665322708993, - "id_str": "648945665322708993", - "indices": [ - 107, - 129 - ], - "media_url": "http://pbs.twimg.com/media/CQGEpPQW8AEZ4X4.jpg", - "media_url_https": "https://pbs.twimg.com/media/CQGEpPQW8AEZ4X4.jpg", - "sizes": { - "large": { - "h": 1495, - "resize": "fit", - "w": 1024 - }, - "medium": { - "h": 876, - "resize": "fit", - "w": 600 - }, - "small": { - "h": 496, - "resize": "fit", - "w": 340 - }, - "thumb": { - "h": 150, - "resize": "crop", - "w": 150 - } - }, - "type": "photo", - "url": "http://t.co/WZfLORunxv" - }], - "symbols": [], - "urls": [], - "user_mentions": [] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945666773917696, - "id_str": "648945666773917696", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 0, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "We are enrolling for our preparation courses for the Oracle Java Certification nationwide #Ireland #techie http://t.co/WZfLORunxv", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Mon Jun 22 18:30:02 +0000 2015", - "default_profile": true, - "default_profile_image": false, - "description": "Zazen Academy of Technology delivers short courses in cutting edge technologies that are in demand by the software industry.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "zazenacademy.ie", - "expanded_url": "http://www.zazenacademy.ie", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/70SrnZMB2P" - }]} - }, - "favourites_count": 27, - "follow_request_sent": false, - "followers_count": 78, - "following": false, - "friends_count": 278, - "geo_enabled": false, - "has_extended_profile": false, - "id": 3341877640, - "id_str": "3341877640", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 12, - "location": "Dublin City, Ireland", - "name": "Zazen Academy", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/3341877640/1441049772", - "profile_image_url": "http://pbs.twimg.com/profile_images/638434928087199744/uzENtEyS_normal.png", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/638434928087199744/uzENtEyS_normal.png", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "C0DEED", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "ZazenAcademy", - "statuses_count": 275, - "time_zone": "Pacific Time (US & Canada)", - "url": "http://t.co/70SrnZMB2P", - "utc_offset": -25200, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:16 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 56, - 74 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 76, - 98 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 99, - 121 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [{ - "id": 1451773004, - "id_str": "1451773004", - "indices": [ - 3, - 17 - ], - "name": "Intl. Space Station", - "screen_name": "Space_Station" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945657365983232, - "id_str": "648945657365983232", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 51, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:38:30 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 37, - 55 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 57, - 79 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 80, - 102 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [] - }, - "favorite_count": 50, - "favorited": false, - "geo": null, - "id": 648944962713878528, - "id_str": "648944962713878528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 51, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 23 15:25:28 +0000 2013", - "default_profile": false, - "default_profile_image": false, - "description": "NASA's page for updates from the International Space Station, the world-class lab orbiting Earth 250 miles above. For the latest research, follow @ISS_Research.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "nasa.gov/station", - "expanded_url": "http://www.nasa.gov/station", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/9Gk2GZYDsP" - }]} - }, - "favourites_count": 1161, - "follow_request_sent": false, - "followers_count": 281874, - "following": false, - "friends_count": 229, - "geo_enabled": false, - "has_extended_profile": false, - "id": 1451773004, - "id_str": "1451773004", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3474, - "location": "Low Earth Orbit", - "name": "Intl. Space Station", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1451773004/1434028060", - "profile_image_url": "http://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "Space_Station", - "statuses_count": 3110, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/9Gk2GZYDsP", - "utc_offset": -18000, - "verified": true - } - }, - "source": "Twitter for Android<\/a>", - "text": "RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Wed Apr 01 08:09:13 +0000 2015", - "default_profile": true, - "default_profile_image": false, - "description": "Blunt, Intelligent, Slightly arrogant jackass with no Instagram account.\n\n\nAtheism.\nNihilism.\nScience!", - "entities": {"description": {"urls": []}}, - "favourites_count": 8199, - "follow_request_sent": false, - "followers_count": 290, - "following": false, - "friends_count": 299, - "geo_enabled": false, - "has_extended_profile": true, - "id": 3123500449, - "id_str": "3123500449", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 23, - "location": "Virgo Supercluster", - "name": "Keegan", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/3123500449/1440644095", - "profile_image_url": "http://pbs.twimg.com/profile_images/608436686310264832/8XTDOq3k_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/608436686310264832/8XTDOq3k_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "C0DEED", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "JohnDoe_997", - "statuses_count": 10816, - "time_zone": null, - "url": null, - "utc_offset": null, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:09 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 56, - 74 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 76, - 98 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 99, - 121 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [{ - "id": 1451773004, - "id_str": "1451773004", - "indices": [ - 3, - 17 - ], - "name": "Intl. Space Station", - "screen_name": "Space_Station" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945627947212800, - "id_str": "648945627947212800", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 49, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:38:30 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 37, - 55 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 57, - 79 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 80, - 102 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [] - }, - "favorite_count": 48, - "favorited": false, - "geo": null, - "id": 648944962713878528, - "id_str": "648944962713878528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 49, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 23 15:25:28 +0000 2013", - "default_profile": false, - "default_profile_image": false, - "description": "NASA's page for updates from the International Space Station, the world-class lab orbiting Earth 250 miles above. For the latest research, follow @ISS_Research.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "nasa.gov/station", - "expanded_url": "http://www.nasa.gov/station", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/9Gk2GZYDsP" - }]} - }, - "favourites_count": 1161, - "follow_request_sent": false, - "followers_count": 281874, - "following": false, - "friends_count": 229, - "geo_enabled": false, - "has_extended_profile": false, - "id": 1451773004, - "id_str": "1451773004", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3474, - "location": "Low Earth Orbit", - "name": "Intl. Space Station", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1451773004/1434028060", - "profile_image_url": "http://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "Space_Station", - "statuses_count": 3110, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/9Gk2GZYDsP", - "utc_offset": -18000, - "verified": true - } - }, - "source": "Twitter Web Client<\/a>", - "text": "RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Wed Jun 01 17:24:02 +0000 2011", - "default_profile": true, - "default_profile_image": false, - "description": "All round sound chap, even if I do say so myself...", - "entities": {"description": {"urls": []}}, - "favourites_count": 187, - "follow_request_sent": false, - "followers_count": 47, - "following": false, - "friends_count": 75, - "geo_enabled": false, - "has_extended_profile": false, - "id": 309178913, - "id_str": "309178913", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 0, - "location": "Edinburgh", - "name": "HighLordAdmiral", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_image_url": "http://pbs.twimg.com/profile_images/1377754097/187661_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/1377754097/187661_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "C0DEED", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "HighLordAdmiral", - "statuses_count": 4390, - "time_zone": "Amsterdam", - "url": null, - "utc_offset": 7200, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:09 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 56, - 74 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 76, - 98 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 99, - 121 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [{ - "id": 1451773004, - "id_str": "1451773004", - "indices": [ - 3, - 17 - ], - "name": "Intl. Space Station", - "screen_name": "Space_Station" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945627649302528, - "id_str": "648945627649302528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 49, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:38:30 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 37, - 55 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 57, - 79 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 80, - 102 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [] - }, - "favorite_count": 48, - "favorited": false, - "geo": null, - "id": 648944962713878528, - "id_str": "648944962713878528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 49, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 23 15:25:28 +0000 2013", - "default_profile": false, - "default_profile_image": false, - "description": "NASA's page for updates from the International Space Station, the world-class lab orbiting Earth 250 miles above. For the latest research, follow @ISS_Research.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "nasa.gov/station", - "expanded_url": "http://www.nasa.gov/station", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/9Gk2GZYDsP" - }]} - }, - "favourites_count": 1161, - "follow_request_sent": false, - "followers_count": 281874, - "following": false, - "friends_count": 229, - "geo_enabled": false, - "has_extended_profile": false, - "id": 1451773004, - "id_str": "1451773004", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3474, - "location": "Low Earth Orbit", - "name": "Intl. Space Station", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1451773004/1434028060", - "profile_image_url": "http://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "Space_Station", - "statuses_count": 3110, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/9Gk2GZYDsP", - "utc_offset": -18000, - "verified": true - } - }, - "source": "Twitter for iPhone<\/a>", - "text": "RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Fri Jul 17 05:14:15 +0000 2015", - "default_profile": true, - "default_profile_image": false, - "description": "I like to think I'm pretty cool.", - "entities": {"description": {"urls": []}}, - "favourites_count": 14, - "follow_request_sent": false, - "followers_count": 17, - "following": false, - "friends_count": 80, - "geo_enabled": false, - "has_extended_profile": false, - "id": 3282141337, - "id_str": "3282141337", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 0, - "location": "", - "name": "Nathan Richards", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_image_url": "http://pbs.twimg.com/profile_images/621913217602707456/iwgRIj05_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/621913217602707456/iwgRIj05_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "C0DEED", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "live_laugh_me", - "statuses_count": 14, - "time_zone": null, - "url": null, - "utc_offset": null, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:07 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 56, - 74 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 76, - 98 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 99, - 121 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [{ - "id": 1451773004, - "id_str": "1451773004", - "indices": [ - 3, - 17 - ], - "name": "Intl. Space Station", - "screen_name": "Space_Station" - }] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945622716940288, - "id_str": "648945622716940288", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 49, - "retweeted": false, - "retweeted_status": { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:38:30 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 37, - 55 - ], - "text": "NationalCoffeeDay" - }], - "symbols": [], - "urls": [ - { - "display_url": "nasa.gov/feature/nation\u2026", - "expanded_url": "http://www.nasa.gov/feature/national-coffee-day-java-in-zero-g/", - "indices": [ - 57, - 79 - ], - "url": "http://t.co/fx4lQcu0Xp" - }, - { - "display_url": "pic.twitter.com/NbOZoQDags", - "expanded_url": "http://twitter.com/Space_Station/status/648944962713878528/photo/1", - "indices": [ - 80, - 102 - ], - "url": "http://t.co/NbOZoQDags" - } - ], - "user_mentions": [] - }, - "favorite_count": 48, - "favorited": false, - "geo": null, - "id": 648944962713878528, - "id_str": "648944962713878528", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "en", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 49, - "retweeted": false, - "source": "Twitter Web Client<\/a>", - "text": "How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu May 23 15:25:28 +0000 2013", - "default_profile": false, - "default_profile_image": false, - "description": "NASA's page for updates from the International Space Station, the world-class lab orbiting Earth 250 miles above. For the latest research, follow @ISS_Research.", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "nasa.gov/station", - "expanded_url": "http://www.nasa.gov/station", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/9Gk2GZYDsP" - }]} - }, - "favourites_count": 1161, - "follow_request_sent": false, - "followers_count": 281874, - "following": false, - "friends_count": 229, - "geo_enabled": false, - "has_extended_profile": false, - "id": 1451773004, - "id_str": "1451773004", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 3474, - "location": "Low Earth Orbit", - "name": "Intl. Space Station", - "notifications": false, - "profile_background_color": "C0DEED", - "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/517439388741931008/iRbQw1ch.jpeg", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/1451773004/1434028060", - "profile_image_url": "http://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/647082562125459456/pmT48eHQ_normal.jpg", - "profile_link_color": "0084B4", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "Space_Station", - "statuses_count": 3110, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/9Gk2GZYDsP", - "utc_offset": -18000, - "verified": true - } - }, - "source": "Twitter for Android<\/a>", - "text": "RT @Space_Station: How do astronauts take their coffee?\n#NationalCoffeeDay \nhttp://t.co/fx4lQcu0Xp http://t.co/NbOZoQDags", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Tue May 24 22:12:02 +0000 2011", - "default_profile": false, - "default_profile_image": false, - "description": "UWGB student, software designer, former Better Explorer developer, anime lover, and all-around weirdo. Enjoy! :) And my girlfriend does too exist!", - "entities": {"description": {"urls": []}}, - "favourites_count": 4590, - "follow_request_sent": false, - "followers_count": 193, - "following": false, - "friends_count": 483, - "geo_enabled": true, - "has_extended_profile": true, - "id": 304662576, - "id_str": "304662576", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 5, - "location": "Wisconsin, United States", - "name": "Jayke R. Huempfner", - "notifications": false, - "profile_background_color": "FFF04D", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme19/bg.gif", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme19/bg.gif", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/304662576/1395796068", - "profile_image_url": "http://pbs.twimg.com/profile_images/2473386566/z6qkl5os1d6awzm4we9e_normal.jpeg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/2473386566/z6qkl5os1d6awzm4we9e_normal.jpeg", - "profile_link_color": "0099CC", - "profile_sidebar_border_color": "000000", - "profile_sidebar_fill_color": "000000", - "profile_text_color": "000000", - "profile_use_background_image": true, - "protected": false, - "screen_name": "JaykeBird", - "statuses_count": 8244, - "time_zone": "Central Time (US & Canada)", - "url": null, - "utc_offset": -18000, - "verified": false - } - }, - { - "contributors": null, - "coordinates": null, - "created_at": "Tue Sep 29 19:41:06 +0000 2015", - "entities": { - "hashtags": [{ - "indices": [ - 23, - 32 - ], - "text": "vacature" - }], - "symbols": [], - "urls": [{ - "display_url": "tc.tradetracker.net/?c=16131&m=585\u2026", - "expanded_url": "http://tc.tradetracker.net/?c=16131&m=585621&a=215767&u=http%3A%2F%2Fwww.stepstone.nl%2Foffers%2Foffer_detail.cfm%3Fid%3D396335%26click%3Dyes%26cid%3DAffiliate_Tradetracker_Affiliate_TradeTracker__", - "indices": [ - 59, - 81 - ], - "url": "http://t.co/eeprR11E0s" - }], - "user_mentions": [] - }, - "favorite_count": 0, - "favorited": false, - "geo": null, - "id": 648945616471592961, - "id_str": "648945616471592961", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "nl", - "metadata": { - "iso_language_code": "nl", - "result_type": "recent" - }, - "place": null, - "possibly_sensitive": false, - "retweet_count": 0, - "retweeted": false, - "source": "Twandoos<\/a>", - "text": "Tijd voor iets nieuws? #vacature Java Software Programmeur http://t.co/eeprR11E0s", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Wed Oct 19 11:04:23 +0000 2011", - "default_profile": false, - "default_profile_image": false, - "description": "Tweet dagelijks recente #vacatures. Laat geen carrière kansen aan je voorbij gaan en volg ons!", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "werkvacature.nl", - "expanded_url": "http://www.werkvacature.nl", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/ULv7bjHdq2" - }]} - }, - "favourites_count": 2, - "follow_request_sent": false, - "followers_count": 29944, - "following": false, - "friends_count": 17399, - "geo_enabled": true, - "has_extended_profile": false, - "id": 393963023, - "id_str": "393963023", - "is_translation_enabled": false, - "is_translator": false, - "lang": "nl", - "listed_count": 164, - "location": "Nederland", - "name": "#vacature", - "notifications": false, - "profile_background_color": "EBEBEB", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme7/bg.gif", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme7/bg.gif", - "profile_background_tile": false, - "profile_image_url": "http://pbs.twimg.com/profile_images/577464263968587776/Hxvo2BtT_normal.jpeg", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/577464263968587776/Hxvo2BtT_normal.jpeg", - "profile_link_color": "89C9FA", - "profile_sidebar_border_color": "DFDFDF", - "profile_sidebar_fill_color": "F3F3F3", - "profile_text_color": "333333", - "profile_use_background_image": true, - "protected": false, - "screen_name": "VacatureWerk", - "statuses_count": 210575, - "time_zone": "Amsterdam", - "url": "http://t.co/ULv7bjHdq2", - "utc_offset": 7200, - "verified": false - } - }, - { - "contributors": null, - "coordinates": { - "coordinates": [ - 114.109497, - 22.396428 - ], - "type": "Point" - }, - "created_at": "Tue Sep 29 19:41:04 +0000 2015", - "entities": { - "hashtags": [ - { - "indices": [ - 11, - 14 - ], - "text": "IT" - }, - { - "indices": [ - 15, - 19 - ], - "text": "Job" - }, - { - "indices": [ - 48, - 57 - ], - "text": "HongKong" - }, - { - "indices": [ - 82, - 94 - ], - "text": "CareersAtTU" - }, - { - "indices": [ - 95, - 104 - ], - "text": "LifeAtTU" - }, - { - "indices": [ - 105, - 110 - ], - "text": "Jobs" - }, - { - "indices": [ - 111, - 118 - ], - "text": "Hiring" - } - ], - "symbols": [], - "urls": [{ - "display_url": "bit.ly/1iZyf8V", - "expanded_url": "http://bit.ly/1iZyf8V", - "indices": [ - 59, - 81 - ], - "url": "http://t.co/I5mcDEBCDB" - }], - "user_mentions": [] - }, - "favorite_count": 0, - "favorited": false, - "geo": { - "coordinates": [ - 22.396428, - 114.109497 - ], - "type": "Point" - }, - "id": 648945609307615232, - "id_str": "648945609307615232", - "in_reply_to_screen_name": null, - "in_reply_to_status_id": null, - "in_reply_to_status_id_str": null, - "in_reply_to_user_id": null, - "in_reply_to_user_id_str": null, - "is_quote_status": false, - "lang": "pl", - "metadata": { - "iso_language_code": "pl", - "result_type": "recent" - }, - "place": { - "attributes": {}, - "bounding_box": { - "coordinates": [[ - [ - 113.9946498, - 22.3126447 - ], - [ - 114.169205, - 22.3126447 - ], - [ - 114.169205, - 22.417555 - ], - [ - 113.9946498, - 22.417555 - ] - ]], - "type": "Polygon" - }, - "contained_within": [], - "country": "香港", - "country_code": "HK", - "full_name": "Tsuen Wan District, Hong Kong", - "id": "0118e53a43a7db78", - "name": "Tsuen Wan District", - "place_type": "admin", - "url": "https://api.twitter.com/1.1/geo/id/0118e53a43a7db78.json" - }, - "possibly_sensitive": false, - "retweet_count": 0, - "retweeted": false, - "source": "SafeTweet by TweetMyJOBS<\/a>", - "text": "TransUnion #IT #Job: System Analyst (Java/JEE) (#HongKong) http://t.co/I5mcDEBCDB #CareersAtTU #LifeAtTU #Jobs #Hiring", - "truncated": false, - "user": { - "contributors_enabled": false, - "created_at": "Thu Jan 16 20:45:42 +0000 2014", - "default_profile": false, - "default_profile_image": false, - "description": "Interested in a #Career w/ @TransUnion? #CareersAtTU offer an enjoyable workspace and seek to ensure a healthy work/life balance. #LifeAtTU", - "entities": { - "description": {"urls": []}, - "url": {"urls": [{ - "display_url": "transunion.com", - "expanded_url": "http://www.transunion.com", - "indices": [ - 0, - 22 - ], - "url": "http://t.co/ULy6IsA7GB" - }]} - }, - "favourites_count": 5, - "follow_request_sent": false, - "followers_count": 260, - "following": false, - "friends_count": 66, - "geo_enabled": true, - "has_extended_profile": false, - "id": 2294998164, - "id_str": "2294998164", - "is_translation_enabled": false, - "is_translator": false, - "lang": "en", - "listed_count": 110, - "location": "", - "name": "TransUnion Jobs", - "notifications": false, - "profile_background_color": "0295BE", - "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", - "profile_background_tile": false, - "profile_banner_url": "https://pbs.twimg.com/profile_banners/2294998164/1403035122", - "profile_image_url": "http://pbs.twimg.com/profile_images/551912214345437184/syc1Yb0R_normal.png", - "profile_image_url_https": "https://pbs.twimg.com/profile_images/551912214345437184/syc1Yb0R_normal.png", - "profile_link_color": "0295BE", - "profile_sidebar_border_color": "FFFFFF", - "profile_sidebar_fill_color": "DDEEF6", - "profile_text_color": "333333", - "profile_use_background_image": false, - "protected": false, - "screen_name": "TransUnion_Jobs", - "statuses_count": 217, - "time_zone": "Central Time (US & Canada)", - "url": "http://t.co/ULy6IsA7GB", - "utc_offset": -18000, - "verified": false - } - } - ] -} \ No newline at end of file diff --git a/andrewgark/.gitignore b/andrewgark/.gitignore deleted file mode 100644 index 0567e201..00000000 --- a/andrewgark/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.properties diff --git a/andrewgark/pom.xml b/andrewgark/pom.xml index 6a8ccf6b..9cc726cc 100644 --- a/andrewgark/pom.xml +++ b/andrewgark/pom.xml @@ -14,6 +14,13 @@ http://maven.apache.org UTF-8 + + + + junit + junit + 3.8.1 + 1.6.3 @@ -33,6 +40,7 @@ junit junit 4.12 + test @@ -51,5 +59,6 @@ 2.2 test + diff --git a/andrewgark/src/main/java/ru/fizteh/fivt/students/App.java b/andrewgark/src/main/java/ru/fizteh/fivt/students/App.java deleted file mode 100644 index 6d2346ff..00000000 --- a/andrewgark/src/main/java/ru/fizteh/fivt/students/App.java +++ /dev/null @@ -1,11 +0,0 @@ -package ru.fizteh.fivt.students; - -/** - * Hello world! - * - */ -public class App { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -} diff --git a/andrewgark/src/test/java/ru/fizteh/fivt/students/AppTest.java b/andrewgark/src/test/java/ru/fizteh/fivt/students/AppTest.java deleted file mode 100644 index 5e698088..00000000 --- a/andrewgark/src/test/java/ru/fizteh/fivt/students/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package ru.fizteh.fivt.students; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/checkstyle.xml b/checkstyle.xml index 58c6a7c5..3d290dcc 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -95,9 +95,7 @@ - - - + diff --git a/github-workflow.md b/github-workflow.md index 0b815d2e..0bf9352d 100644 --- a/github-workflow.md +++ b/github-workflow.md @@ -17,7 +17,7 @@ ``` -5. Добавить в свой [pom.xml](akormushin/pom.xml) ссылку на родительский модуль, если её там ещё не было. Нужно, чтобы унаследовать общие параметры сборки проекта. +5. Добавить в свой [pom.xml](akormushin/pom.xml) ссылку на родительский модуль. Нужно, чтобы унаследовать общие параметры сборки проекта. ``` @@ -31,7 +31,7 @@ ## Работа над заданием 1. Свои классы нужно добавлять в директории ```/src/main/java/ru/fizteh/fivt/students//```. 2. Сборка модуля производится командой ```mvn package```. -3. Запускать приложение можно прямо из maven командой ```mvn exec:java -Dexec.mainClass= -Dexec.args=""```. Она сама добавит в classpath транзативно все необходимые библиотеки из pom.xml dependencies. +3. Запускать приложение можно прямо из maven командой ```mvn exec:java -Dexec.mainClass= -Dexec.arguments=```. Она сама добавит в classpath транзативно все необходимые библиотеки из pom.xml dependencies. Также можно запускать с помощью команды java. Для этого нужно: 1. Выполнить единожды ```mvn dependency:copy-dependencies```. Эта команда скопирует все необходимые зависимости в target/dependency. @@ -43,6 +43,9 @@ В одном pull request должно быть решение только одной задачи. Если хочется сдавать параллельно несколько заданий, необходимо создавать бранчи и делать pull request из бранчей. 4. Результаты сборки можно смотреть [тут](https://travis-ci.org/akormushin/fizteh-java-2015) +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD 5. Если pull-request не мержится "This branch has conflicts that must be resolved", надо смержить себе мои изменения. 5. Далее нужно провести ревью пулл реквестов как минимум 2х (двух) ваших одногруппников или ребят из параллельной группы, как вам удобно. 1. Отметить в [журнале успеваемости](https://docs.google.com/spreadsheets/d/1LhwKlMmQbG2aIBT0FmUS8HMmd5pcpWr0bnlDw7Ypkt4/edit?usp=sharing) в колонек Ревьюверы себя через запятую напротив фамилии того, кого ревьювите, например, Каргальцев Степан хочет проверить задание 2 у Зерцалова Андрея: в Е9 нужно вписать Каргальцев Степан. @@ -55,11 +58,21 @@ 2. Запустить приложение с разными параметрами и убедиться, что оно удовлетворяет спецификации (заданию) или указать на ошибки. 3. Посмотреть код и попытаться выявить возможные нефункциональные ошибки и недочёты. 4. После исправлений вашего коллеги - проверить ещё раз. +<<<<<<< HEAD +======= +>>>>>>> parent of 617098e... Merge +======= +>>>>>>> parent of 617098e... Merge +======= +>>>>>>> parent of 617098e... Merge + +======= 6. Задание считается выполненным, если: 1. Приложение функционально соответствует спецификации 2. Код прошёл ревью и не содержит неустранённых замечаний. 3. Вы провели ревью pull request'ов как минимум 2х коллег и нашли как минимум 10 существенных замечаний. Hack: если вы или я обнаружили у вас в коде какую-то проблему - с большой вероятностью она будет у многих. Можно пройтись по 10ти pull request'ам и всем указать на неё же. PROFIT. +>>>>>>> akormushin/master ## Синхронизация с базовым репозиторием Периодически синхронизируйтесь с базовым репозиторием, чтобы получать актуальные версии скриптов для сборки и примеров. diff --git a/ocksumoron/.gitignore b/ocksumoron/.gitignore deleted file mode 100644 index 7f59e8c1..00000000 --- a/ocksumoron/.gitignore +++ /dev/null @@ -1 +0,0 @@ -twitter4j.properties \ No newline at end of file diff --git a/ocksumoron/pom.xml b/ocksumoron/pom.xml deleted file mode 100644 index 9dab73c7..00000000 --- a/ocksumoron/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - 4.0.0 - - ru.fizteh.fivt.students - parent - 1.0-SNAPSHOT - - ru.fizteh.fivt.students - ocksumoron - 1.0-SNAPSHOT - ocksumoron - http://maven.apache.org - - UTF-8 - - - - junit - junit - 3.8.1 - test - - - com.beust - jcommander - 1.48 - - - org.twitter4j - twitter4j-stream - 4.0.4 - - - - org.jsoup - jsoup - 1.8.3 - - - diff --git a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/helloworld/App.java b/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/helloworld/App.java deleted file mode 100644 index 5f90206e..00000000 --- a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/helloworld/App.java +++ /dev/null @@ -1,11 +0,0 @@ -package main.java.ru.fizteh.fivt.students.helloworld; - -/** - * Hello world! - * - */ -public class App { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -} diff --git a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/FormatMaster.java b/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/FormatMaster.java deleted file mode 100644 index 78705449..00000000 --- a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/FormatMaster.java +++ /dev/null @@ -1,112 +0,0 @@ -package ru.fizteh.fivt.students.ocksumoron.twitterstream; - -import twitter4j.Status; - -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.temporal.ChronoUnit; -import java.util.Date; - -/** - * Created by ocksumoron on 30.09.15. - */ -public class FormatMaster { - - static final int GET_LAST_NUM = 10; - static final int GET_LAST_TWO_NUMS = 100; - static final int NUMBER_ONE = 1; - static final int NUMBER_FIVE = 5; - static final int NUMBER_ELEVEN = 11; - static final int NUMBER_NINETEEN = 19; - static final String SEPARATOR = - "\n-----------------------------------------------------------------------------------------------------\n"; - - private static final String[] MINUTES_FORMS = {"минуту", "минуты", "минут"}; - private static final String[] HOURS_FORMS = {"час", "часа", "часов"}; - private static final String[] DAYS_FORMS = {"день", "дня", "дней"}; - - private static final String[][] TIME_FORMS = {MINUTES_FORMS, HOURS_FORMS, DAYS_FORMS}; - - private static final String[] RETWEET_FORMS = {"ретвит", "ретвита", "ретвитов"}; - - private enum ETime { - MINUTE (0), - HOUR (1), - DAY (2); - - private int type; - - private int getType() { - return type; - } - - ETime(int type) { - this.type = type; - } - } - - private static ETime getCorrectForm(long number) { - if (number % GET_LAST_NUM == NUMBER_ONE && number % GET_LAST_TWO_NUMS != NUMBER_ELEVEN) { - return ETime.MINUTE; - } - if (number % GET_LAST_NUM > NUMBER_ONE && number % GET_LAST_NUM < NUMBER_FIVE - && !(number % GET_LAST_TWO_NUMS >= NUMBER_ELEVEN && number % GET_LAST_TWO_NUMS <= NUMBER_NINETEEN)) { - return ETime.HOUR; - } - return ETime.DAY; - } - - private static String getTimeString(long number, ETime type) { - ETime correctForm = getCorrectForm(number); - return " " + TIME_FORMS[type.getType()][correctForm.getType()]; - } - - - private static String formatTime(Date date) { - LocalDateTime tweetDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); - LocalDateTime curDate = LocalDateTime.now(); - long minuteDiff = ChronoUnit.MINUTES.between(tweetDate, curDate); - long hourDiff = ChronoUnit.HOURS.between(tweetDate, curDate); - long dayDiff = ChronoUnit.DAYS.between(tweetDate, curDate); - if (minuteDiff < 2) { - return "только что"; - } else if (hourDiff == 0) { - return Long.toString(minuteDiff) - + getTimeString(minuteDiff, ETime.MINUTE); - } else if (ChronoUnit.DAYS.between(tweetDate, curDate) == 0) { - return Long.toString(hourDiff) - + getTimeString(hourDiff, ETime.HOUR); - } else if (dayDiff == NUMBER_ONE) { - return "вчера"; - } else { - return Long.toString(dayDiff) - + getTimeString(dayDiff, ETime.DAY); - } - } - - public static String format(Status s, boolean isHideRetweets, boolean isStream) { - StringBuilder result = new StringBuilder(""); - if (!isStream) { - String time = formatTime(s.getCreatedAt()); - result.append("[" + time + "]"); - } - if (!isHideRetweets) { - if (s.isRetweet()) { - result.append("@" + s.getUser().getName() + " ретвитнул @" - + s.getRetweetedStatus().getUser().getName() + ": " + s.getRetweetedStatus().getText()); - } else { - result.append("@" + s.getUser().getName() + ": " + s.getText()); - if (s.getRetweetCount() != 0) { - result.append(" (" + Long.toString(s.getRetweetCount()) + " " - + RETWEET_FORMS[getCorrectForm(s.getRetweetCount()).getType()] + ")"); - } - } - result.append(SEPARATOR); - return result.toString(); - } else if (!s.isRetweeted()) { - result.append("@" + s.getUser().getName() + ": " + s.getText() + SEPARATOR); - return result.toString(); - } - return ""; - } -} diff --git a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/JCommanderProperties.java b/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/JCommanderProperties.java deleted file mode 100644 index d11349b5..00000000 --- a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/JCommanderProperties.java +++ /dev/null @@ -1,53 +0,0 @@ -package ru.fizteh.fivt.students.ocksumoron.twitterstream; - -import com.beust.jcommander.*; - -/** - * Created by ocksumoron on 24.09.15. - */ -public class JCommanderProperties { - - private static final int DEFAULT_LIMIT = 100; - - @Parameter(names = {"-q", "--query"}, description = "Query type") - private String query = ""; - - @Parameter(names = {"-p", "--place"}, description = "Place type") - private String place = "nearby"; - - @Parameter(names = {"-s", "--stream"}, description = "Stream mode") - private boolean isStream = false; - - @Parameter(names = {"--hideRetweets"}, description = "Hide retweets") - private boolean hideRetweets = false; - - @Parameter(names = {"-l", "--limit"}, description = "Tweets limit") - private Integer limitNumber = DEFAULT_LIMIT; - - @Parameter(names = {"-h", "--help"}, description = "Print help") - private boolean printHelp = false; - - public boolean isPrintHelp() { - return printHelp; - } - - public Integer getLimitNumber() { - return limitNumber; - } - - public boolean isHideRetweets() { - return hideRetweets; - } - - public boolean isStream() { - return isStream; - } - - public String getPlace() { - return place; - } - - public String getQuery() { - return query; - } -} diff --git a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/Location.java b/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/Location.java deleted file mode 100644 index c3f80e1b..00000000 --- a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/Location.java +++ /dev/null @@ -1,88 +0,0 @@ -package ru.fizteh.fivt.students.ocksumoron.twitterstream; - -import twitter4j.GeoLocation; - -/** - * Created by ocksumoron on 28.09.15. - */ -public final class Location { - private final double res; - private final double latitudeCenter; - private final double longitudeCenter; - private final double latitudeSWCorner; - private final double longitudeSWCorner; - private final double latitudeNECorner; - private final double longitudeNECorner; - private final int error; - - public Location(double latitudeCenter, double longitudeCenter, - double latitudeSWCorner, double longitudeSWCorner, - double latitudeNECorner, double longitudeNECorner, double res) { - this.latitudeCenter = latitudeCenter; - this.longitudeCenter = longitudeCenter; - this.latitudeSWCorner = latitudeSWCorner; - this.longitudeSWCorner = longitudeSWCorner; - this.latitudeNECorner = latitudeNECorner; - this.longitudeNECorner = longitudeNECorner; - this.res = res; - this.error = 0; - } - - public Location(GeoLocation center, GeoLocation cornerSW, GeoLocation cornerNE, double res) { - this.latitudeCenter = center.getLatitude(); - this.longitudeCenter = center.getLongitude(); - this.latitudeSWCorner = cornerSW.getLatitude(); - this.longitudeSWCorner = cornerSW.getLongitude(); - this.latitudeNECorner = cornerNE.getLatitude(); - this.longitudeNECorner = cornerNE.getLongitude(); - this.res = res; - this.error = 0; - } - - public Location(int error) { - this.latitudeCenter = 0; - this.longitudeCenter = 0; - this.latitudeSWCorner = 0; - this.longitudeSWCorner = 0; - this.latitudeNECorner = 0; - this.longitudeNECorner = 0; - this.res = 0; - this.error = error; - } - - public GeoLocation getGeoLocation() { - return new GeoLocation(latitudeCenter, longitudeCenter); - } - - public double getRes() { - return res; - } - - public double getLatitudeCenter() { - return latitudeCenter; - } - - public double getLongitudeCenter() { - return longitudeCenter; - } - - public double getLatitudeSWCorner() { - return latitudeSWCorner; - } - - public double getLongitudeSWCorner() { - return longitudeSWCorner; - } - - public double getLatitudeNECorner() { - return latitudeNECorner; - } - - public double getLongitudeNECorner() { - return longitudeNECorner; - } - - public int getError() { - return error; - } -} diff --git a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/LocationMaster.java b/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/LocationMaster.java deleted file mode 100644 index 3b515d36..00000000 --- a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/LocationMaster.java +++ /dev/null @@ -1,78 +0,0 @@ -package ru.fizteh.fivt.students.ocksumoron.twitterstream; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; -import twitter4j.GeoLocation; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; - -/** - * Created by ocksumoron on 24.09.15. - */ -public class LocationMaster { - - private static final int DEFAULT_RES = 5; - - private GeoLocation getCoordinates(NodeList sections) { - Element section = (Element) sections.item(0); - String coordinates = section.getTextContent(); - String[] coordinatesParsed = coordinates.split(" "); - Double longitude = Double.parseDouble(coordinatesParsed[0]); - Double latitude = Double.parseDouble(coordinatesParsed[1]); - return new GeoLocation(latitude, longitude); - } - - private double getRes(GeoLocation lowerCornerPos, GeoLocation upperCornerPos) { - return DEFAULT_RES; - } - - private Document documentResolver(URL url) - throws MalformedURLException, IOException, ParserConfigurationException, SAXException { - URLConnection geoConnection = url.openConnection(); - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setIgnoringComments(true); - factory.setCoalescing(true); - factory.setNamespaceAware(false); - factory.setValidating(false); - - DocumentBuilder parser = factory.newDocumentBuilder(); - - Document document = parser.parse(geoConnection.getInputStream()); - return document; - } - - public Location getLocation(String place) { - try { - if (place.equals("nearby")) { - Document document = documentResolver(new URL("http://api.hostip.info/")); - NodeList requiredTagList = document.getElementsByTagName("gml:name"); - if (requiredTagList.getLength() < 2) { - return new Location(-1); - } - Element section = (Element) requiredTagList.item(1); - place = section.getTextContent(); - } - - Document document = documentResolver(new URL("https://geocode-maps.yandex.ru/1.x/?geocode=" + place)); - if (document.getElementsByTagName("pos").getLength() == 0) { - return new Location(-1); - } - GeoLocation centerPos = getCoordinates(document.getElementsByTagName("pos")); - GeoLocation swPos = getCoordinates(document.getElementsByTagName("lowerCorner")); - GeoLocation nePos = getCoordinates(document.getElementsByTagName("upperCorner")); - double res = getRes(swPos, nePos); - return new Location(centerPos, swPos, nePos, res); - } catch (IOException | ParserConfigurationException | SAXException e) { - e.printStackTrace(); - } - return new Location(-1); - } -} diff --git a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/Twister.java b/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/Twister.java deleted file mode 100644 index bfbeaf73..00000000 --- a/ocksumoron/src/main/java/ru/fizteh/fivt/students/ocksumoron/twitterstream/Twister.java +++ /dev/null @@ -1,95 +0,0 @@ -package ru.fizteh.fivt.students.ocksumoron.twitterstream; - -import com.beust.jcommander.JCommander; -import twitter4j.*; - -/** - * Created by ocksumoron on 16.09.15. - */ - -public class Twister { - - private static final long MILLISEC_IN_SEC = 1000; - - public static void main(String[] args) { - JCommanderProperties jcp = new JCommanderProperties(); - try { - JCommander jParser = new JCommander(jcp, args); - if (jcp.isPrintHelp()) { - jParser.usage(); - } - if (!jcp.isStream()) { - printTweets(jcp); - } else { - printStream(jcp); - } - } catch (Exception e) { - e.printStackTrace(); - new JCommander(jcp).usage(); - } - } - - public static void printTweets(JCommanderProperties jcp) { - LocationMaster locationMaster = new LocationMaster(); - try { - Location location = locationMaster.getLocation(jcp.getPlace()); - if (location.getError() != 0) { - System.err.println("Bad location"); - System.exit(1); - } - GeoLocation geoLocation = new GeoLocation(location.getLatitudeCenter(), location.getLongitudeCenter()); - Twitter twitter = new TwitterFactory().getInstance(); - Query query = new Query(jcp.getQuery()); - query.setCount(jcp.getLimitNumber()); - Query.Unit resUnit = Query.Unit.km; - query.setGeoCode(geoLocation, location.getRes(), resUnit); - query.setCount(jcp.getLimitNumber()); - FormatMaster formatter = new FormatMaster(); - twitter.search(query).getTweets().stream() - .map(s -> formatter.format(s, jcp.isHideRetweets(), false)).forEach(System.out::print); - - } catch (TwitterException e) { - e.printStackTrace(); - } - } - - public static void printStream(JCommanderProperties jcp) { - FormatMaster formatter = new FormatMaster(); - LocationMaster locationMaster = new LocationMaster(); - Location location = locationMaster.getLocation(jcp.getPlace()); - if (location.getError() == 0) { - FilterQuery filterQuery = new FilterQuery(); - String[] keyword = {jcp.getQuery()}; - - double[][] locationBox = {{location.getLongitudeSWCorner(), location.getLatitudeSWCorner()}, - {location.getLongitudeNECorner(), location.getLatitudeNECorner()}}; - - filterQuery.track(keyword); - - filterQuery.locations(locationBox); - - TwitterStream twitterStream = new TwitterStreamFactory().getInstance(); - - twitterStream.addListener(new StatusAdapter() { - @Override - public void onStatus(Status status) { - try { - Thread.sleep(MILLISEC_IN_SEC); - } catch (InterruptedException e) { - e.printStackTrace(); - } - System.out.print(formatter.format(status, jcp.isHideRetweets(), true)); - } - - @Override - public void onException(Exception ex) { - TwitterException twex = (TwitterException) ex; - twex.printStackTrace(); - } - }); - twitterStream.filter(filterQuery); - } else { - System.err.println("Bad location"); - } - } -} diff --git a/ocksumoron/src/test/java/ru/fizteh/fivt/students/ocksumoron/helloworld/AppTest.java b/ocksumoron/src/test/java/ru/fizteh/fivt/students/ocksumoron/helloworld/AppTest.java deleted file mode 100644 index ce7c89b2..00000000 --- a/ocksumoron/src/test/java/ru/fizteh/fivt/students/ocksumoron/helloworld/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package test.java.ru.fizteh.fivt.students.helloworld; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ -// public AppTest( String testName ) -// { -// super( testName ); -// } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/pom.xml b/pom.xml index a2fdfbd2..24e6b351 100644 --- a/pom.xml +++ b/pom.xml @@ -22,8 +22,7 @@ egiby akormushin - - okalitova + okalitova xmanatee mamaevads cache-nez @@ -37,15 +36,15 @@ sergmiller zakharovas zemen - w4r10ck1337 - preidman - Jettriangle + w4r10ck1337 + preidman + Jettriangle nmakeenkov - - oshch + oshch ladyae nikitarykov duha666 + preidman @@ -65,7 +64,7 @@ org.hamcrest - hamcrest-all + hamcrest-core 1.3 test @@ -126,4 +125,4 @@ HEAD - + \ No newline at end of file diff --git a/preidman/pom.xml b/preidman/pom.xml index 7cd55159..7b87ce90 100644 --- a/preidman/pom.xml +++ b/preidman/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 diff --git a/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/BlockingQueue.java b/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/BlockingQueue.java new file mode 100644 index 00000000..7b534a4d --- /dev/null +++ b/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/BlockingQueue.java @@ -0,0 +1,124 @@ +package ru.fizteh.fivt.students.preidman.threads; + +import java.util.concurrent.*; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.locks.*; +import java.util.ArrayList; + + +public class BlockingQueue { + + private final int volume; + private Lock l; + + private Condition takeCond; + private Condition putCond; + + private Queue queueBl; + + public BlockingQueue(int maxSize) { + + volume = maxSize; + queueBl = new LinkedList<>(); + + l = new ReentrantLock(); + + takeCond = l.newCondition(); + putCond = l.newCondition(); + + } + + public final void offer(List newqueueBl) throws InterruptedException, TimeoutException { + + offer(newqueueBl, 0); + + } + + public final void offer(List newqueueBl, long t) throws InterruptedException, TimeoutException { + + l.lock(); + + try { + + long time = TimeUnit.MILLISECONDS.toNanos(t); + + boolean isAdd = true; + + + while ((t == 0 || time > 0) && queueBl.size() + newqueueBl.size() > volume) { + + if (t == 0) putCond.await(); + else { + + time = putCond.awaitNanos(time); + if (time < 0) isAdd = false; + + } + + } + + + if (isAdd) { + + queueBl.addAll(newqueueBl); + + if (newqueueBl.size() > 0) takeCond.signal(); + + } else throw new TimeoutException(); + + } finally { + + l.unlock(); + + } + } + + + public final List take(int count) throws InterruptedException { + + return take(count, 0); + + } + + public final List take(int kol, long t) throws InterruptedException { + + l.lock(); + + try { + + long time = TimeUnit.MILLISECONDS.toNanos(t); + + while (queueBl.size() < kol && (t == 0 || time > 0)) { + + if (t == 0) takeCond.await(); + else { + + time = takeCond.awaitNanos(time); + if (time < 0) return null; + + } + + } + + List tmp = new ArrayList<>(); + + for (int i = 0; i < kol; ++i) { + + tmp.add(queueBl.poll()); + + } + + if (kol > 0) putCond.signal(); + + return tmp; + + } finally { + + l.unlock(); + + } + } + +} \ No newline at end of file diff --git a/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/NumerableThread.java b/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/NumerableThread.java new file mode 100644 index 00000000..6123247f --- /dev/null +++ b/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/NumerableThread.java @@ -0,0 +1,63 @@ +package ru.fizteh.fivt.students.preidman.threads; + + +public class NumerableThread { + + public static void main(String[] args) { + + new NumerableThread(Integer.valueOf(args[0])); + + } + + + + private final int kol; + + private Integer par; + + + + public class Numerator extends Thread { + + private int num; + + public Numerator(int x) { + num = x; + } + + @Override + public final void run() { + + while (true) { + + synchronized (par) { + + if (par.equals(num - 1)) { + + System.out.println("Thread-" + num); + par++; + + if (par.equals(kol)) par = 0; + + } + } + + } + } + } + + public NumerableThread(int numberOfThreads) { + + kol = numberOfThreads; + + par = 0; + + for (int i = 0; i < kol; ++i) { + + Thread count = new Numerator(i + 1); + count.start(); + + } + } + +} diff --git a/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/RollingThread.java b/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/RollingThread.java new file mode 100644 index 00000000..33c10e4e --- /dev/null +++ b/preidman/src/main/java/ru/fizteh/fivt/students/preidman/threads/RollingThread.java @@ -0,0 +1,170 @@ +package ru.fizteh.fivt.students.preidman.threads; + +import java.util.concurrent.Semaphore; +import java.util.Random; + +public class RollingThread implements Runnable { + + + public static void main(String[] args) { + + new RollingThread (Integer.valueOf(args[0])).run(); + + } + + + + private int countOfReady; + + private int numberOfThreads; + private Responder[] students; + private Integer numberOfYes; + + private Semaphore turn; + private Boolean end; + + + + + + public RollingThread (int x) { + + numberOfYes = 0; + end = false; + numberOfThreads = x; + + turn = new Semaphore(numberOfThreads); + + try { + + turn.acquire(numberOfThreads); + + } catch (InterruptedException e) { + + e.printStackTrace(); + System.exit(-1); + + } + + + students = new Responder[numberOfThreads]; + + for (int i = 0; i < numberOfThreads; ++i) { + + students[i] = new Responder(); + + try { + + students[i].answPls.acquire(); + + } catch (InterruptedException e) { + + e.printStackTrace(); + System.exit(-1); + + } + } + } + + + + @Override + public final void run() { + + boolean ready = false; + + for (int i = 0; i < numberOfThreads; ++i) { + + students[i].start(); + + } + + while (!ready) { + + System.out.println("Are you ready?"); + goAnswer(); + + try { + + turn.acquire(numberOfThreads); + synchronized (numberOfYes) { + + if (countOfReady == numberOfThreads) { + + ready = true; + end = true; + goAnswer(); + + } + + numberOfYes = 0; + countOfReady = 0; + } + + } catch (InterruptedException e) { + + e.printStackTrace(); + + } + } + } + + + + private void goAnswer() { + + for (int i = 0; i < numberOfThreads; ++i) { + + students[i].answPls.release(); + + } + + } + + public class Responder extends Thread { + + private Random maybe = new Random(); + + private Semaphore answPls = new Semaphore(1); + + @Override + public final void run() { + + while (true) { + + try { + + answPls.acquire(); + + synchronized (end) { + + if (end) return; + + } + + boolean yes = true; + + if (maybe.nextInt(10) == 0) yes = false; + + if (!yes) System.out.println(getName() + ": No"); + else System.out.println(getName() + ": Yes"); + + + synchronized (numberOfYes) { + + numberOfYes++; + if (yes) countOfReady++; + + } + + turn.release(); + + } catch (InterruptedException e) { + + System.err.println(e.getMessage()); + + } + } + } + } +} \ No newline at end of file diff --git a/seminars.md b/seminars.md index 93fb50f7..1171e9aa 100644 --- a/seminars.md +++ b/seminars.md @@ -21,29 +21,30 @@ * [Maven by Example](http://books.sonatype.com/mvnex-book/reference/index.html) * Задание на дом: [TwitterStream](/tasks/01-TwitterStream.md) -## Семинар 3: ООП -* ООП - * [Lesson: Object-Oriented Programming Concepts](https://docs.oracle.com/javase/tutorial/java/concepts/index.html) - * [Lesson: Classes and Objects](https://docs.oracle.com/javase/tutorial/java/javaOO/index.html) +## Семинар 3: Модульное тестирование * Аннотации * [Lesson: Annotations](https://docs.oracle.com/javase/tutorial/java/annotations/) -* Динамическая информация о метаданных - * [Trail: The Reflection API](https://docs.oracle.com/javase/tutorial/reflect/index.html) -* Работа с датой (самостоятельно) - * [Trail: Date Time](https://docs.oracle.com/javase/tutorial/datetime/TOC.html) -* Задание на дом: [то же](/tasks/01-TwitterStream.md) - -## Семинар 4: Модульное тестирование -* Исключения - * [Lesson: Exceptions](https://docs.oracle.com/javase/tutorial/essential/exceptions/) -* Зависимости (test) - * [Maven: Introduction to the Dependency Mechanism](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope) * Модульное тестирование +* Инструменты * [JUnit](http://junit.org) * [Mockito](http://site.mockito.org/mockito/docs/current/org/mockito/Mockito.html) +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD * [IntelliJ IDEA Help - Testing](https://www.jetbrains.com/idea/help/testing.html?search=testing) * [IntelliJ IDEA Help - Code Coverage](https://www.jetbrains.com/idea/help/code-coverage.html?search=coverage) * Задание на дом: [ModuleTests](/tasks/02-ModuleTests.md) +<<<<<<< HEAD +======= +======= +* Задание на дом: [TBD](/tasks) +>>>>>>> parent of 617098e... Merge +======= +* Задание на дом: [TBD](/tasks) +>>>>>>> parent of 617098e... Merge +======= +* Задание на дом: [TBD](/tasks) +>>>>>>> parent of 617098e... Merge ## Семинар 5: Модульное тестирование (продолжение) * Модульное тестирование @@ -80,6 +81,7 @@ * [CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html) * Задание на дом: То же +>>>>>>> akormushin/master ## Семинар 9: JDBC * JDBC diff --git a/src/ru/fizteh/fivt/students/EkaterinaVishnevskaya/reverser/Main.java b/src/ru/fizteh/fivt/students/EkaterinaVishnevskaya/reverser/Main.java deleted file mode 100644 index 9295fa0e..00000000 --- a/src/ru/fizteh/fivt/students/EkaterinaVishnevskaya/reverser/Main.java +++ /dev/null @@ -1,18 +0,0 @@ -package ru.fizteh.fivt.students.EkaterinaVishnevskaya.reverser; - -public class Main { - - public static void main(String[] args) - { - for (int i=args.length; i>=0; i--) - { - String[] result = args[i].split("\\s+"); - for (int j=result.length; j>=0; j--) - { - System.out.print(result[j]+' '); - } - System.out.println(); - } - - } -} diff --git a/src/ru/fizteh/fivt/students/linkov/Reverser/Reverser.java b/src/ru/fizteh/fivt/students/linkov/Reverser/Reverser.java deleted file mode 100644 index 4df0557b..00000000 --- a/src/ru/fizteh/fivt/students/linkov/Reverser/Reverser.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Created by evlinkov on 20.09.15. - */ - -public class Reverser { - public static void main(String[] args) { - String[] numbers; - for (int i = args.length - 1; i >= 0; i--) { - numbers = args[i].split("\\s+"); - for (int j = numbers.length - 1; j >= 0; --j) { - System.out.print(numbers[j] + " "); - } - } - System.out.print("\n"); - } -} - diff --git a/tasks/01-TwitterStream.md b/tasks/01-TwitterStream.md index 80f8789f..6059f17e 100644 --- a/tasks/01-TwitterStream.md +++ b/tasks/01-TwitterStream.md @@ -12,14 +12,9 @@ java TwitterStream \ [--help|-h] ``` ###Параметры -* place - искать по заданному региону (например, "долгопрудный", "москва", "татарстан"). -Так как в апи нет буквально таких методов. Можно сделать поиск мест по запросу Twitter.searchPlaces(). -Для Twitter.search использовать среднее арифметическое широты и долготы Place.getBoundingBoxCoordinates() и радиус как половину максимального расстояния между точками. -Для TwitterStream.filter использовать прямоугольник из максимальных координат из Place.getBoundingBoxCoordinates() -Кажется, грубо, но должно сработать. Кто нашёл другое апи для геокодинга - отлично. (доп. опция на 10ку) - -nearby - определить регион по ip (доп. опция на 10ку) +* place - искать по заданному региону. Если значение равно nearby или параметр отсутствует - искать по ip * stream - если параметр задан, то приложение должно равномерно и непрерывно с задержкой в 1 секунду печать твиты на экран. + Для выхода из приложения использовать ESC. Также приложение должно корректно завершаться по Ctrl+D (Ctrl+Break на Windows) * hideRetweets - если параметр задан, нужно фильтровать ретвиты * limit - выводить только твитов. Не применимо для --stream режима * help - печатает справку. Например, этот файл с заданием или краткую справку. С хорошим форматированием @@ -37,6 +32,7 @@ nearby - определить регион по ip (доп. опция на 10к ---------------------------------------------------------------------------------------- ``` +* Nick долен быть выделен синим цветом. * В случае ошибок соединения приложение должно выводить диагностику в stderr и переподключаться. * Никаких ошибок в stdout быть не должно. * Если по запросу не найдено ни одного твита - нужно вывести соответствующее сообщение в stdout. diff --git a/tasks/02-ModuleTests.md b/tasks/02-ModuleTests.md deleted file mode 100644 index 6253d76a..00000000 --- a/tasks/02-ModuleTests.md +++ /dev/null @@ -1,24 +0,0 @@ -## JUnit - -Нужно сделать из TwitterStream переиспользуемую библиотеку. Покрыть все библиотечные и публичные методы тестами используя заглушки для сетевых сервисов. - -* Функциональность типа геокодирования, форматирования временного периода, разбора входных параметров, получения и форматирования твитов нужно выделить в отдельные классы и оформить как библиотеку полезных классов в отдельном пакете ```ru.fizteh.fivt.students..moduletests.library```: - * Если есть несколько реализаций, как у геокодирования, выделить интерфейсы - * Библиотечные классы не должны ничего выводить на экран (stdout и stderr). Результат работы должен возвращаться методами. - * Если есть логика вывода на экран достойная тестирования (содержит хотя бы одно ветвление), то лучше в библиотечные методы или в конструктор класса передавать в качестве параметра типа Writer System.out. Так его можно будет заменить заглушкой и проверить правильность вывода в тестах. И библиотеку можно будет использовать для печати в файл, при желании. - * Никаких System.exit() из библиотечных классов, только исключения. - * Ваш ```main()``` из [второго задания](/tasks/01-TwitterStream.md) должен использовать новые библиотечные классы. -* Покрытие тестами должно быть не менее 70% строк кода, лучше более. -* Тесты должны покрывать все требования из [TwitterStream](/tasks/01-TwitterStream.md) + возможные исключения. То есть, если у вас какой-нибудь метод при каком-то понятном условии может выкинуть Exception - то этот случай должен быть покрыт тестом. - -Тесты можно запускать командой ```mvn test``` или из IDE, так же как и ```main()```. - -## Рекомендации: -1. Нужно отрефакторить классы так, чтобы внешние сервисы можно было заменять на заглушки. Например, делать фабричные статические методы или конструкторы, которые принимают классы для соединения с сервисами. -2. Не реализуйте никакой логики в конструкторе, в нём только сохранение параметров. -2. Классы разбить на небольшие, с обособленной функциональностью. -3. Смотрите мои примеры: - * [Библиотека](/akormushin/src/main/java/ru/fizteh/fivt/students/akormushin/moduletests/library) - * [Тесты](/akormushin/src/test/java/ru/fizteh/fivt/students/akormushin/moduletests/library) - - diff --git a/thefacetakt/pom.xml b/thefacetakt/pom.xml index 6cbd09a6..b1db2b3a 100644 --- a/thefacetakt/pom.xml +++ b/thefacetakt/pom.xml @@ -31,6 +31,14 @@ +<<<<<<< HEAD + junit + junit + 3.8.1 + + +======= +>>>>>>> akormushin/master org.twitter4j twitter4j-stream [4.0,) @@ -40,6 +48,8 @@ jcommander 1.48 +<<<<<<< HEAD +======= commons-io commons-io @@ -57,6 +67,7 @@ 19.0 +>>>>>>> akormushin/master src/main/java diff --git a/thefacetakt/src/main/java/ru/fizteh/fivt/students/thefacetakt/reverser/Reverser.java b/thefacetakt/src/main/java/ru/fizteh/fivt/students/thefacetakt/reverser/Reverser.java deleted file mode 100644 index 91a100f6..00000000 --- a/thefacetakt/src/main/java/ru/fizteh/fivt/students/thefacetakt/reverser/Reverser.java +++ /dev/null @@ -1,38 +0,0 @@ -/** -* A solution to the /tasks/00-Reverser.md task -*/ - -package ru.fizteh.fivt.students.thefacetakt.reverser; - -/** -* A class with solution implementation. -*/ -public final class Reverser { - - /** - * Declaring private constructor in order not to have - * default one as stylecheck requires. - */ - - private Reverser() { - } - - /** - * Implementation of solution itself. - * @param args **command line arguments** - */ - - public static void main(final String[] args) { - for (int i = args.length - 1; i >= 0; --i) { - String[] current = args[i].split("\\s+"); - for (int j = current.length - 1; j >= 0; --j) { - System.out.print(current[j]); - if (i + j == 0) { - System.out.print("\n"); - } else { - System.out.printf(" "); - } - } - } - } -} diff --git a/thefacetakt/src/main/java/ru/fizteh/fivt/students/thefacetakt/twitterstream/TwitterStream.java b/thefacetakt/src/main/java/ru/fizteh/fivt/students/thefacetakt/twitterstream/TwitterStream.java index ba385b12..2c30c05a 100644 --- a/thefacetakt/src/main/java/ru/fizteh/fivt/students/thefacetakt/twitterstream/TwitterStream.java +++ b/thefacetakt/src/main/java/ru/fizteh/fivt/students/thefacetakt/twitterstream/TwitterStream.java @@ -5,33 +5,71 @@ */ import com.beust.jcommander.*; +<<<<<<< HEAD +import ru.fizteh.fivt.students.thefacetakt.twitterstream + .exceptions.InvalidLocationException; +import ru.fizteh.fivt.students.thefacetakt.twitterstream + .exceptions.LocationDefinitionErrorException; +import ru.fizteh.fivt.students.thefacetakt + .twitterstream.exceptions.NoKeyException; +======= import ru.fizteh.fivt.students.thefacetakt.twitterstream.library.*; import ru.fizteh.fivt.students.thefacetakt.twitterstream.library.exceptions.InvalidLocationException; import ru.fizteh.fivt.students.thefacetakt.twitterstream.library.exceptions.LocationDefinitionErrorException; import ru.fizteh.fivt.students.thefacetakt.twitterstream.library.exceptions.NoKeyException; import ru.fizteh.fivt.students.thefacetakt.twitterstream.library.exceptions.TwitterStreamException; +>>>>>>> akormushin/master import twitter4j.*; import java.net.MalformedURLException; import java.util.*; +<<<<<<< HEAD + public class TwitterStream { + static final int MINUSES_COUNT = 140; + static final int MAX_NUMBER_OF_TRIES = 2; + static final double RADIUS = 10; + static final String RADIUS_UNIT = "km"; + +======= +public class TwitterStream { + +>>>>>>> akormushin/master private static PlaceLocationResolver geoResolver; static { try { +<<<<<<< HEAD + geoResolver = new PlaceLocationResolver(); +======= geoResolver = new PlaceLocationResolver(new HttpReader()); +>>>>>>> akormushin/master } catch (NoKeyException e) { System.err.println(e.getMessage()); System.exit(1); } } +<<<<<<< HEAD + static void printSeparator() { + for (int i = 0; i < MINUSES_COUNT; ++i) { + System.out.print("-"); + } + System.out.println(); + } + + static Location resolveLocation(String passedLocation) + throws LocationDefinitionErrorException, InvalidLocationException, + MalformedURLException { + Location result = null; +======= static ru.fizteh.fivt.students.thefacetakt.twitterstream.library.Location resolveLocation(String passedLocation) throws LocationDefinitionErrorException, InvalidLocationException, MalformedURLException { ru.fizteh.fivt.students.thefacetakt.twitterstream.library.Location result = null; +>>>>>>> akormushin/master if (passedLocation.equals(JCommanderSetting.DEFAULT_LOCATION)) { result = geoResolver.resolveCurrentLocation(); } else { @@ -41,6 +79,198 @@ static ru.fizteh.fivt.students.thefacetakt.twitterstream.library.Location resolv } +<<<<<<< HEAD + + static final String ANSI_RESET = "\u001B[0m"; + static final String ANSI_BLUE = "\u001B[34m"; + static void printNick(String nick) { + + System.out.print("@" + ANSI_BLUE + nick + ": " + ANSI_RESET); + } + + + //RT @nick: + static final int RT_SPACE_AT_LENGTH = 4; + static void printTweet(Status status) { + printNick(status.getUser().getScreenName()); + if (!status.isRetweet()) { + System.out.print(status.getText()); + + if (status.getRetweetCount() != 0) { + System.out.print(" (" + + status.getRetweetCount() + " " + + Declenser.retweetDeclension(status.getRetweetCount()) + + ")" + ); + } + } else { + System.out.print("ретвитнул "); + String[] splittedText = status.getText().split(":"); + + String originalNick = splittedText[0].substring(RT_SPACE_AT_LENGTH); + printNick(originalNick); + ArrayList originalText = new ArrayList( + Arrays.asList(splittedText) + .subList(1, splittedText.length - 1) + ); + + System.out.print(String.join(":", originalText)); + } + System.out.println(); + } + + static void printTweetsOnce(JCommanderSetting jCommanderSettings, + Location currentLocation, String queryString) { + + int numberOfTries = 0; + + do { + try { + Twitter twitter = TwitterFactory.getSingleton(); + + Query query = new Query(queryString).geoCode( + new GeoLocation( + currentLocation.getLatitude(), + currentLocation.getLongitude()), RADIUS, + RADIUS_UNIT); + + query.setCount(jCommanderSettings.getLimit()); + + QueryResult result = twitter.search(query); + + + long currentTime = System.currentTimeMillis(); + + List tweets = result.getTweets(); + Collections.reverse(tweets); + + if (tweets.isEmpty()) { + System.out.println("Не найдено ни одного твита"); + printSeparator(); + } + + for (Status status : tweets) { + if (!status.isRetweet() + || !jCommanderSettings.isHideRetweets()) { + + System.out.print("[" + + TimeFormatter.formatTime(currentTime, + status.getCreatedAt().getTime()) + "] "); + + printTweet(status); + + printSeparator(); + } + } + numberOfTries = MAX_NUMBER_OF_TRIES; + } catch (TwitterException te) { + ++numberOfTries; + if (numberOfTries == MAX_NUMBER_OF_TRIES) { + System.out.println(te.getMessage()); + System.err.println("Something went terribly wrong, " + + "probably - connection + error"); + System.exit(1); + } + } + } while (numberOfTries < MAX_NUMBER_OF_TRIES); + } + + static double sqr(double x) { + return x * x; + } + + //https://en.wikipedia.org/wiki/Great-circle_distance#Formulas + static final double EARTH_RADIUS = 6371; + static final double RADIANS_IN_DEGREE = Math.PI / 180; + + static double toRadians(double angle) { + return angle * RADIANS_IN_DEGREE; + } + + static double sphereDistance(double phi1, double lambda1, + double phi2, double lambda2) { + phi1 = toRadians(phi1); + phi2 = toRadians(phi2); + lambda1 = toRadians(lambda1); + lambda2 = toRadians(lambda2); + + double deltaPhi = phi2 - phi1; + double deltaLambda = lambda2 - lambda1; + + return 2 * Math.asin(Math.sqrt(sqr(Math.sin(deltaPhi / 2)) + + Math.cos(phi1) * Math.cos(phi2) + * sqr(Math.sin(deltaLambda / 2)))) + * EARTH_RADIUS; + } + + static void printTwitterStream(JCommanderSetting jCommanderSetting, + Location currentLocation) { + + twitter4j.TwitterStream twitterStream = + new TwitterStreamFactory().getInstance(); + + twitterStream.addListener(new StatusAdapter() { + @Override + public void onStatus(Status status) { + + if (jCommanderSetting.isHideRetweets() + && status.isRetweet()) { + return; + } + + Location tweetLocation = null; + if (status.getGeoLocation() != null) { + tweetLocation = new Location( + status.getGeoLocation().getLatitude(), + status.getGeoLocation().getLongitude()); + } else { + if (status.getUser().getLocation() != null) { + try { + tweetLocation = + geoResolver.resolvePlaceLocation( + status.getUser().getLocation()); + } catch (InvalidLocationException + | LocationDefinitionErrorException + | MalformedURLException e) { + return; + } + } else { + return; + } + } + + assert tweetLocation != null; + + if (sphereDistance(tweetLocation.getLatitude(), + tweetLocation.getLongitude(), + currentLocation.getLatitude(), + currentLocation.getLongitude() + ) < RADIUS) { + printTweet(status); + printSeparator(); + } + } + }); + + String[] trackArray = jCommanderSetting.getQueries().toArray( + new String[jCommanderSetting.getQueries().size()] + ); + + twitterStream.filter(new FilterQuery().track(trackArray)); + } + + static void readUntilCtrlD() { + Scanner scanner = new Scanner(System.in); + while (scanner.hasNext()) { + int checkstyleWantAtLeastOneStatement = 0; + // waiting for end of input + } + scanner.close(); + System.exit(0); + } + + public static void main(String[] args) { +======= static void readUntilCtrlD() { try (Scanner scanner = new Scanner(System.in)) { while (scanner.hasNext()) { @@ -51,6 +281,7 @@ static void readUntilCtrlD() { } public static void main(String[] args) throws TwitterException { +>>>>>>> akormushin/master JCommanderSetting jCommanderSettings = new JCommanderSetting(); @@ -63,13 +294,21 @@ public static void main(String[] args) throws TwitterException { } catch (ParameterException pe) { JCommander jCommander = new JCommander(jCommanderSettings, +<<<<<<< HEAD + new String[] {"--query", "query"}); +======= "--query", "query"); +>>>>>>> akormushin/master jCommander.setProgramName("TwitterStream"); jCommander.usage(); return; } +<<<<<<< HEAD + Location currentLocation = null; +======= ru.fizteh.fivt.students.thefacetakt.twitterstream.library.Location currentLocation = null; +>>>>>>> akormushin/master try { currentLocation = resolveLocation( jCommanderSettings.getLocation() @@ -81,6 +320,18 @@ public static void main(String[] args) throws TwitterException { System.exit(1); } +<<<<<<< HEAD + String queryString = String.join(" ", jCommanderSettings.getQueries()); + System.out.println("Твиты по запросу " + + queryString + " для " + + currentLocation.getName()); + printSeparator(); + + if (!jCommanderSettings.isStream()) { + printTweetsOnce(jCommanderSettings, currentLocation, queryString); + } else { + printTwitterStream(jCommanderSettings, currentLocation); +======= Printer tweetsPrinter = new Printer(System.out); TweetsGetter tweetsGetter = new TweetsGetter(geoResolver); @@ -102,6 +353,7 @@ public static void main(String[] args) throws TwitterException { tweetsGetter.getTwitterStream(jCommanderSettings, currentLocation, tweetsPrinter::print, new TwitterStreamFactory().getInstance()); +>>>>>>> akormushin/master readUntilCtrlD(); } } diff --git a/thefacetakt/src/main/resources/.gitignore b/thefacetakt/src/main/resources/.gitignore deleted file mode 100644 index bbafc235..00000000 --- a/thefacetakt/src/main/resources/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -twitter4j.properties -geo.properties diff --git a/thefacetakt/src/main/resources/log4j.properties b/thefacetakt/src/main/resources/log4j.properties deleted file mode 100644 index 44244a45..00000000 --- a/thefacetakt/src/main/resources/log4j.properties +++ /dev/null @@ -1,6 +0,0 @@ -log4j.rootLogger=INFO, stderr - -log4j.appender.stderr = org.apache.log4j.ConsoleAppender -log4j.appender.stderr.Target = System.err -log4j.appender.stderr.layout = org.apache.log4j.PatternLayout -log4j.appender.stderr.layout.ConversionPattern = %-5p %d [%t][%F:%L] : %m%n