This repository was archived by the owner on Nov 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 51
51
<relativePath >../pom.xml</relativePath >
52
52
</parent >
53
53
54
- <packaging >pom </packaging >
54
+ <packaging >jar </packaging >
55
55
<url >http://maven.apache.org</url >
56
56
<artifactId >jsondemos-twitter</artifactId >
57
57
79
79
<target >1.7</target >
80
80
</configuration >
81
81
</plugin >
82
- <!-- mvn exec:java
83
82
<plugin >
84
83
<groupId >org.codehaus.mojo</groupId >
85
84
<artifactId >exec-maven-plugin</artifactId >
92
91
</execution >
93
92
</executions >
94
93
<configuration >
95
- <mainClass>org.glassfish.jsondemos.twitter.TwitterStreamSearch </mainClass>
94
+ <mainClass >org.glassfish.jsondemos.twitter.TwitterObjectSearch </mainClass >
96
95
</configuration >
97
96
</plugin >
98
- -->
99
97
</plugins >
100
98
</build >
101
99
</project >
Original file line number Diff line number Diff line change @@ -85,11 +85,17 @@ public static void main(String... args) throws Exception {
85
85
System .out .println (result .get ("text" ));
86
86
System .out .println ("-----------" );
87
87
}
88
+
89
+ // All the tweets are collected into Stream<String> and printed
90
+ // obj.getJsonArray("statuses").getValuesAs(JsonObject.class)
91
+ // .stream()
92
+ // .map(v -> v.getString("text"))
93
+ // .forEach(s -> { System.out.println(s); } );
88
94
}
89
95
}
90
96
91
97
static InputStream getSearchStream () throws Exception {
92
- final String searchStr = "#telugu " ;
98
+ final String searchStr = "#javaone " ;
93
99
String searchUrl = "https://api.twitter.com/1.1/search/tweets.json" ;
94
100
95
101
Properties config = new Properties ();
You can’t perform that action at this time.
0 commit comments