├── .gitattributes ├── twitter4j-examples ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ └── java │ │ └── twitter4j │ │ └── examples │ │ ├── help │ │ ├── GetPrivacyPolicy.java │ │ └── GetTermsOfService.java │ │ ├── account │ │ └── VerifyCredentials.java │ │ ├── block │ │ ├── GetBlockingUsersIDs.java │ │ ├── CreateBlock.java │ │ └── DestroyBlock.java │ │ ├── spamreporting │ │ └── ReportSpam.java │ │ ├── favorite │ │ └── GetFavorites.java │ │ ├── tweets │ │ └── DestroyStatus.java │ │ └── timeline │ │ └── GetMentions.java └── bin │ ├── twitter4j.properties │ ├── setEnv.cmd │ ├── async │ ├── asyncUpdate.sh │ └── asyncUpdate.cmd │ ├── json │ ├── loadRawJSON.sh │ ├── saveRawJSON.sh │ ├── loadRawJSON.cmd │ └── saveRawJSON.cmd │ ├── user │ ├── showUser.sh │ ├── lookupUsers.sh │ ├── searchUsers.sh │ ├── showUser.cmd │ ├── lookupUsers.cmd │ └── searchUsers.cmd │ ├── geo │ ├── createPlace.sh │ ├── getGeoDetails.sh │ ├── searchPlaces.sh │ ├── getSimilarPlaces.sh │ ├── reverseGeoCode.sh │ ├── createPlace.cmd │ ├── searchPlaces.cmd │ ├── getGeoDetails.cmd │ ├── reverseGeoCode.cmd │ └── getSimilarPlaces.cmd │ ├── list │ ├── getUserLists.sh │ ├── showUserList.sh │ ├── createUserList.sh │ ├── destroyUserList.sh │ ├── getAllUserLists.sh │ ├── updateUserList.sh │ ├── addUserListMember.sh │ ├── getUserListStatuses.sh │ ├── addUserListMembers.sh │ ├── deleteUserListMember.sh │ ├── getUserListMembers.sh │ ├── getUserListMemberships.sh │ ├── getUserListSubscribers.sh │ ├── showUserListMembership.sh │ ├── getUserListSubscriptions.sh │ ├── showUserListSubscription.sh │ ├── createUserListSubscription.sh │ ├── destroyUserListSubscription.sh │ ├── getUserLists.cmd │ ├── showUserList.cmd │ ├── createUserList.cmd │ ├── destroyUserList.cmd │ ├── getAllUserLists.cmd │ ├── updateUserList.cmd │ ├── addUserListMember.cmd │ ├── addUserListMembers.cmd │ ├── getUserListMembers.cmd │ ├── deleteUserListMember.cmd │ ├── getUserListStatuses.cmd │ ├── getUserListMemberships.cmd │ ├── getUserListSubscribers.cmd │ ├── showUserListMembership.cmd │ ├── createUserListSubscription.cmd │ ├── getUserListSubscriptions.cmd │ ├── showUserListSubscription.cmd │ └── destroyUserListSubscription.cmd │ ├── search │ ├── searchTweets.sh │ └── searchTweets.cmd │ ├── timeline │ ├── getMentions.sh │ ├── getHomeTimeline.sh │ ├── getUserTimeline.sh │ ├── getMentions.cmd │ ├── getHomeTimeline.cmd │ └── getUserTimeline.cmd │ ├── tweets │ ├── showStatus.sh │ ├── destroyStatus.sh │ ├── getRetweets.sh │ ├── retweetStatus.sh │ ├── updateStatus.sh │ ├── updateStatus.cmd │ ├── getRetweets.cmd │ ├── showStatus.cmd │ ├── destroyStatus.cmd │ └── retweetStatus.cmd │ ├── block │ ├── createBlock.sh │ ├── destroyBlock.sh │ ├── getBlockingUsers.sh │ ├── getBlockingUsersIDs.sh │ ├── createBlock.cmd │ ├── destroyBlock.cmd │ ├── getBlockingUsers.cmd │ └── getBlockingUsersIDs.cmd │ ├── help │ ├── getPrivacyPolicy.sh │ ├── getTermsOfService.sh │ ├── getPrivacyPolicy.cmd │ └── getTermsOfService.cmd │ ├── stream │ ├── printUserStream.sh │ ├── printFilterStream.sh │ ├── printLinksStream.sh │ ├── printRetweetStream.sh │ ├── printSampleStream.sh │ ├── printFirehoseStream.sh │ ├── printRawSampleStream.sh │ ├── printSiteStreams.sh │ ├── printFilterStream.cmd │ ├── printLinksStream.cmd │ ├── printSampleStream.cmd │ ├── printSiteStreams.cmd │ ├── printUserStream.cmd │ ├── printFirehoseStream.cmd │ ├── printRetweetStream.cmd │ └── printRawSampleStream.cmd │ ├── spamreporting │ ├── reportSpam.sh │ └── reportSpam.cmd │ ├── account │ ├── updateProfile.sh │ ├── verifyCredentials.sh │ ├── getAccountSettings.sh │ ├── getRateLimitStatus.sh │ ├── updateProfileColors.sh │ ├── updateProfileImage.sh │ ├── updateProfileBackgroundImage.sh │ ├── updateProfile.cmd │ ├── getAccountSettings.cmd │ ├── getRateLimitStatus.cmd │ ├── updateProfileImage.cmd │ ├── verifyCredentials.cmd │ ├── updateProfileColors.cmd │ └── updateProfileBackgroundImage.cmd │ ├── favorite │ ├── getFavorites.sh │ ├── createFavorite.sh │ ├── destroyFavorite.sh │ ├── getFavorites.cmd │ ├── createFavorite.cmd │ └── destroyFavorite.cmd │ ├── getAccessToken.cmd │ ├── media │ ├── imgLyImageUpload.sh │ ├── yFrogImageUpload.sh │ ├── twippleImageUpload.sh │ ├── twitpicImageUpload.sh │ ├── tweetPhotoImageUpload.sh │ ├── imgLyImageUpload.cmd │ ├── yFrogImageUpload.cmd │ ├── twippleImageUpload.cmd │ ├── twitpicImageUpload.cmd │ └── tweetPhotoImageUpload.cmd │ ├── trends │ ├── getAvailableTrends.sh │ ├── getLocationTrends.sh │ ├── getAvailableTrends.cmd │ └── getLocationTrends.cmd │ ├── friendship │ ├── showFriendship.sh │ ├── createFriendship.sh │ ├── updateFriendship.sh │ ├── destroyFriendship.sh │ ├── lookupFriendships.sh │ ├── getIncomingFriendships.sh │ ├── getOutgoingFriendships.sh │ ├── showFriendship.cmd │ ├── createFriendship.cmd │ ├── destroyFriendship.cmd │ ├── lookupFriendships.cmd │ ├── updateFriendship.cmd │ ├── getIncomingFriendships.cmd │ └── getOutgoingFriendships.cmd │ ├── directmessage │ ├── getDirectMessages.sh │ ├── sendDirectMessage.sh │ ├── showDirectMessage.sh │ ├── destroyDirectMessage.sh │ ├── getSentDirectMessages.sh │ ├── getDirectMessages.cmd │ ├── sendDirectMessage.cmd │ ├── showDirectMessage.cmd │ ├── destroyDirectMessage.cmd │ └── getSentDirectMessages.cmd │ ├── getAccessToken.sh │ ├── savedsearches │ ├── getSavedSearches.sh │ ├── showSavedSearch.sh │ ├── createSavedSearch.sh │ ├── destroySavedSearch.sh │ ├── createSavedSearch.cmd │ ├── getSavedSearches.cmd │ ├── showSavedSearch.cmd │ └── destroySavedSearch.cmd │ ├── suggestedusers │ ├── getMemberSuggestions.sh │ ├── getUserSuggestions.sh │ ├── getSuggestedUserCategories.sh │ ├── getUserSuggestions.cmd │ ├── getMemberSuggestions.cmd │ └── getSuggestedUserCategories.cmd │ ├── friendsandfollowers │ ├── getFollowersIDs.sh │ ├── getFriendsIDs.sh │ ├── getFriendsIDs.cmd │ └── getFollowersIDs.cmd │ ├── setEnv.sh │ └── logback.xml ├── powered-by-badge ├── powered-by-twitter4j.psd ├── powered-by-twitter4j-138x30.gif ├── powered-by-twitter4j-138x30.png ├── powered-by-twitter4j-border-138x30.gif ├── powered-by-twitter4j-border-138x30.png ├── readme-ja.txt └── readme.txt ├── twitter4j-async └── src │ ├── test │ └── resources │ │ ├── t4j.gif │ │ ├── t4j.png │ │ ├── t4j.jpeg │ │ ├── t4j-reverse.gif │ │ ├── t4j-reverse.png │ │ └── t4j-reverse.jpeg │ └── main │ ├── resources │ └── META-INF │ │ └── MANIFEST.MF │ └── java │ └── twitter4j │ ├── api │ ├── SearchResourceAsync.java │ └── UndocumentedResourcesAsync.java │ ├── VersionAsync.java │ └── AsyncTwitter.java ├── twitter4j-core └── src │ ├── test │ ├── resources │ │ ├── t4j.gif │ │ ├── t4j.jpeg │ │ ├── t4j.png │ │ ├── t4j-banner.gif │ │ ├── t4j-banner.jpeg │ │ ├── t4j-banner.png │ │ ├── t4j-reverse.gif │ │ ├── t4j-reverse.jpeg │ │ ├── t4j-reverse.png │ │ ├── twitter4j.properties │ │ ├── error.json │ │ └── test.properties-template │ └── java │ │ └── twitter4j │ │ ├── SSLTestUnit.java │ │ ├── MBeansIntegrationTest.java │ │ ├── SpamReportingResourceTest.java │ │ ├── http │ │ └── BASE64EncoderTest.java │ │ └── internal │ │ └── util │ │ └── ParseUtilTest.java │ └── main │ ├── resources │ └── META-INF │ │ └── MANIFEST.MF │ └── java │ └── twitter4j │ ├── internal │ ├── http │ │ ├── HttpResponseListener.java │ │ ├── RequestMethod.java │ │ ├── HttpClientWrapperConfiguration.java │ │ ├── HttpClient.java │ │ ├── HttpClientConfiguration.java │ │ ├── HttpClientBase.java │ │ └── StreamingGZIPInputStream.java │ ├── org │ │ └── json │ │ │ └── JSONException.java │ ├── async │ │ └── Dispatcher.java │ ├── logging │ │ ├── JULLoggerFactory.java │ │ ├── Log4JLoggerFactory.java │ │ ├── LoggerFactory.java │ │ ├── SLF4JLoggerFactory.java │ │ ├── NullLoggerFactory.java │ │ ├── StdOutLoggerFactory.java │ │ └── CommonsLoggingLoggerFactory.java │ └── json │ │ └── EntityIndex.java │ ├── Place.java │ ├── Category.java │ ├── TimeZone.java │ ├── Friendship.java │ ├── ResponseList.java │ ├── Location.java │ ├── PagableResponseList.java │ ├── IDs.java │ ├── management │ ├── InvocationStatistics.java │ └── APIStatisticsMBean.java │ ├── Trend.java │ ├── SavedSearch.java │ ├── auth │ ├── AuthorizationConfiguration.java │ ├── Authorization.java │ └── NullAuthorization.java │ ├── ConnectionLifeCycleListener.java │ ├── TwitterAPIConfiguration.java │ ├── SimilarPlaces.java │ ├── CursorSupport.java │ ├── SymbolEntity.java │ ├── StatusDeletionNotice.java │ ├── Version.java │ ├── conf │ └── ConfigurationFactory.java │ ├── RateLimitStatusListener.java │ ├── DirectMessage.java │ ├── Twitter.java │ ├── TweetEntity.java │ ├── HashtagEntity.java │ ├── RelatedResults.java │ ├── Trends.java │ ├── AccountTotals.java │ ├── api │ └── SearchResource.java │ ├── util │ └── CharacterUtil.java │ ├── QueryResult.java │ ├── TwitterResponse.java │ └── RateLimitStatusEvent.java ├── twitter4j-stream └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ └── java │ │ └── twitter4j │ │ ├── StreamImplementation.java │ │ ├── StreamListener.java │ │ ├── RawStreamListener.java │ │ ├── StatusStream.java │ │ ├── UserStream.java │ │ ├── VersionStream.java │ │ └── StatusAdapter.java │ └── test │ └── resources │ ├── stallwarning.json │ └── dao │ ├── suggestions.json │ ├── 3c6797665e2d42eb.json │ ├── 5a110d312052166f.json │ ├── user.json │ └── 24696018620.json ├── twitter4j-appengine └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ └── java │ │ └── twitter4j │ │ ├── TwitterRuntimeException.java │ │ ├── AppEngineTwitterImpl.java │ │ ├── VersionAppEngine.java │ │ └── internal │ │ └── json │ │ └── LazyPagableResponseList.java │ └── test │ └── resources │ └── generate-lazy-objects.sh ├── twitter4j-media-support └── src │ ├── test │ └── resources │ │ ├── t4j.jpeg │ │ └── twitter4j.properties-template │ └── main │ ├── resources │ └── META-INF │ │ └── MANIFEST.MF │ └── java │ └── twitter4j │ └── media │ ├── MediaProvider.java │ ├── Version.java │ └── ImageUpload.java ├── readme-libs.txt └── .gitignore /.gitattributes: -------------------------------------------------------------------------------- 1 | *.java set diff 2 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-Vendor: Yusuke Yamamoto 3 | -------------------------------------------------------------------------------- /powered-by-badge/powered-by-twitter4j.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/powered-by-badge/powered-by-twitter4j.psd -------------------------------------------------------------------------------- /twitter4j-async/src/test/resources/t4j.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-async/src/test/resources/t4j.gif -------------------------------------------------------------------------------- /twitter4j-async/src/test/resources/t4j.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-async/src/test/resources/t4j.png -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j.gif -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j.jpeg -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j.png -------------------------------------------------------------------------------- /twitter4j-async/src/test/resources/t4j.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-async/src/test/resources/t4j.jpeg -------------------------------------------------------------------------------- /twitter4j-core/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-Vendor: Yusuke Yamamoto 3 | Main-Class: twitter4j.Version 4 | -------------------------------------------------------------------------------- /powered-by-badge/powered-by-twitter4j-138x30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/powered-by-badge/powered-by-twitter4j-138x30.gif -------------------------------------------------------------------------------- /powered-by-badge/powered-by-twitter4j-138x30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/powered-by-badge/powered-by-twitter4j-138x30.png -------------------------------------------------------------------------------- /twitter4j-async/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-Vendor: Yusuke Yamamoto 3 | Main-Class: twitter4j.VersionAsync 4 | -------------------------------------------------------------------------------- /twitter4j-async/src/test/resources/t4j-reverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-async/src/test/resources/t4j-reverse.gif -------------------------------------------------------------------------------- /twitter4j-async/src/test/resources/t4j-reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-async/src/test/resources/t4j-reverse.png -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j-banner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j-banner.gif -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j-banner.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j-banner.jpeg -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j-banner.png -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j-reverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j-reverse.gif -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j-reverse.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j-reverse.jpeg -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/t4j-reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-core/src/test/resources/t4j-reverse.png -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/twitter4j.properties: -------------------------------------------------------------------------------- 1 | debug=true 2 | loggerFactory=twitter4j.internal.logging.StdOutLoggerFactory 3 | jsonStoreEnabled=true -------------------------------------------------------------------------------- /twitter4j-stream/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-Vendor: Yusuke Yamamoto 3 | Main-Class: twitter4j.VersionStream 4 | -------------------------------------------------------------------------------- /twitter4j-appengine/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-Vendor: Yusuke Yamamoto 3 | Main-Class: twitter4j.VersionAppEngine 4 | -------------------------------------------------------------------------------- /twitter4j-async/src/test/resources/t4j-reverse.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-async/src/test/resources/t4j-reverse.jpeg -------------------------------------------------------------------------------- /twitter4j-media-support/src/test/resources/t4j.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/twitter4j-media-support/src/test/resources/t4j.jpeg -------------------------------------------------------------------------------- /powered-by-badge/powered-by-twitter4j-border-138x30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/powered-by-badge/powered-by-twitter4j-border-138x30.gif -------------------------------------------------------------------------------- /powered-by-badge/powered-by-twitter4j-border-138x30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/corymsmith/twitter4j/master/powered-by-badge/powered-by-twitter4j-border-138x30.png -------------------------------------------------------------------------------- /twitter4j-media-support/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-Vendor: Yusuke Yamamoto 3 | Main-Class: twitter4j.media.Version 4 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/twitter4j.properties: -------------------------------------------------------------------------------- 1 | oauth.consumerKey=7ZVgfKiOvBDcDFpytRWSA 2 | oauth.consumerSecret=JmeJVeym78arzmGthrDUshQyhkq6nWA9tWLUKxc 3 | debug=true 4 | http.prettyDebug=true -------------------------------------------------------------------------------- /twitter4j-examples/bin/setEnv.cmd: -------------------------------------------------------------------------------- 1 | @rem JAVA_HOME=C:\Program Files\Java\jre1.6.0_10 2 | 3 | for %%i in (..\lib\*.jar) do set CLASSPATH=!CLASSPATH!;%%i 4 | 5 | set MEM_ARGS=-Xms30m -Xmx30m -------------------------------------------------------------------------------- /twitter4j-examples/bin/async/asyncUpdate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.async.AsyncUpdate" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/json/loadRawJSON.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.json.LoadRawJSON" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/json/saveRawJSON.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.json.SaveRawJSON" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/user/showUser.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.user.ShowUser" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/createPlace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.geo.CreatePlace" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserLists.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.GetUserLists" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/showUserList.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.ShowUserList" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/search/searchTweets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.search.SearchTweets" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/timeline/getMentions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.timeline.GetMentions" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/showStatus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.tweets.ShowStatus" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/user/lookupUsers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.user.LookupUsers" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/user/searchUsers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.user.SearchUsers" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/block/createBlock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.block.CreateBlock" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/getGeoDetails.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.geo.GetGeoDetails" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/searchPlaces.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.geo.SearchPlaces" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/help/getPrivacyPolicy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.help.GetPrivacyPolicy" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/help/getTermsOfService.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.help.GetTermsOfService" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/createUserList.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.CreateUserList" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/destroyUserList.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.DestroyUserList" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getAllUserLists.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.GetAllUserLists" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/updateUserList.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.UpdateUserList" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printUserStream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.stream.PrintUserStream" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/destroyStatus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.tweets.DestroyStatus" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/getRetweets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.tweets.GetRetweets" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/retweetStatus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.tweets.RetweetStatus" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/updateStatus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.tweets.UpdateStatus" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/block/destroyBlock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.block.DestroyBlock" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/getSimilarPlaces.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.geo.GetSimilarPlaces" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/reverseGeoCode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.geo.ReverseGeoCode" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/spamreporting/reportSpam.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.spamreporting.ReportSpam" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printFilterStream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.stream.PrintFilterStream" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printLinksStream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.stream.PrintLinksStream" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printRetweetStream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.stream.PrintRetweetStream" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printSampleStream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.stream.PrintSampleStream" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/timeline/getHomeTimeline.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.timeline.GetHomeTimeline" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/timeline/getUserTimeline.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.timeline.GetUserTimeline" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/updateProfile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.account.UpdateProfile" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/block/getBlockingUsers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.block.GetBlockingUsers" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/favorite/getFavorites.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.favorite.GetFavorites" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/getAccessToken.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | call setEnv.cmd 4 | 5 | echo on 6 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.oauth.GetAccessToken %* 7 | 8 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/addUserListMember.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.AddUserListMember" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListStatuses.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.GetUserListStatuses" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/imgLyImageUpload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.media.ImgLyImageUpload" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/yFrogImageUpload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.media.YFrogImageUpload" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printFirehoseStream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.stream.PrintFirehoseStream" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printRawSampleStream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.stream.PrintRawSampleStream" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printSiteStreams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.stream.PrintSiteStreams" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} 7 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/trends/getAvailableTrends.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.trends.GetAvailableTrends" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/trends/getLocationTrends.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.trends.GetLocationTrends" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/verifyCredentials.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.account.VerifyCredentials" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/block/getBlockingUsersIDs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.block.GetBlockingUsersIDs" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/favorite/createFavorite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.favorite.CreateFavorite" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/favorite/destroyFavorite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.favorite.DestroyFavorite" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/showFriendship.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendship.ShowFriendship" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/addUserListMembers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.AddUserListMembers" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/deleteUserListMember.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.DeleteUserListMember" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListMembers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.GetUserListMembers" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListMemberships.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.GetUserListMemberships" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/twippleImageUpload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.media.TwippleImageUpload" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/twitpicImageUpload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.media.TwitpicImageUpload" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/getAccountSettings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.account.GetAccountSettings" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/getRateLimitStatus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.account.GetRateLimitStatus" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/updateProfileColors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.account.UpdateProfileColors" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/updateProfileImage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.account.UpdateProfileImage" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/getDirectMessages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.directmessage.GetDirectMessages" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/sendDirectMessage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.directmessage.SendDirectMessage" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/showDirectMessage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.directmessage.ShowDirectMessage" 5 | echo $RUN_CMD ${1+"$@"} 6 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/createFriendship.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendship.CreateFriendship" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/updateFriendship.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendship.UpdateFriendship" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/json/loadRawJSON.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.json.LoadRawJSON %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/json/saveRawJSON.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.json.SaveRawJSON %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListSubscribers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.GetUserListSubscribers" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/showUserListMembership.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.ShowUserListMembership" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/tweetPhotoImageUpload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.media.TweetPhotoImageUpload" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/async/asyncUpdate.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.async.AsyncUpdate %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/destroyFriendship.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendship.DestroyFriendship" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/lookupFriendships.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendship.LookupFriendships" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/getAccessToken.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . ./setEnv.sh 3 | 4 | echo $JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.oauth.GetAccessToken "$@" 5 | $JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.oauth.GetAccessToken "$@" -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListSubscriptions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | 6 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.GetUserListSubscriptions" 7 | echo $RUN_CMD ${1+"$@"} 8 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/showUserListSubscription.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.ShowUserListSubscription" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/savedsearches/getSavedSearches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.savedsearches.GetSavedSearches" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/savedsearches/showSavedSearch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.savedsearches.ShowSavedSearch" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/search/searchTweets.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.search.SearchTweets %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/updateStatus.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.tweets.UpdateStatus %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/help/getPrivacyPolicy.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.help.GetPrivacyPolicy %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/createUserListSubscription.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.CreateUserListSubscription" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/destroyUserListSubscription.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.DestroyUserListSubscription" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/savedsearches/createSavedSearch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.savedsearches.CreateSavedSearch" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/savedsearches/destroySavedSearch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.savedsearches.DestroySavedSearch" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/suggestedusers/getMemberSuggestions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.suggestedusers.GetMemberSuggestions" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/suggestedusers/getUserSuggestions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.suggestedusers.GetUserSuggestions" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/timeline/getMentions.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.timeline.GetMentions %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/user/showUser.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.user.ShowUser %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/destroyDirectMessage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.directmessage.DestroyDirectMessage" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/getSentDirectMessages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.directmessage.GetSentDirectMessages" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendsandfollowers/getFollowersIDs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendsandfollowers.GetFollowersIDs" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendsandfollowers/getFriendsIDs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendsandfollowers.GetFriendsIDs" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/getIncomingFriendships.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendship.GetIncomingFriendships" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/getOutgoingFriendships.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.friendship.GetOutgoingFriendships" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/createPlace.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.geo.CreatePlace %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/searchPlaces.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.geo.SearchPlaces %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/help/getTermsOfService.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.help.GetTermsOfService %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/spamreporting/reportSpam.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.spamreporting.ReportSpam %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printFilterStream.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.stream.PrintFilterStream %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printLinksStream.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.stream.PrintLinksStream %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printSampleStream.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.stream.PrintSampleStream %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printSiteStreams.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.stream.PrintSiteStreams %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printUserStream.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.stream.PrintUserStream %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/timeline/getHomeTimeline.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.timeline.GetHomeTimeline %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/timeline/getUserTimeline.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.timeline.GetUserTimeline %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/user/lookupUsers.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.user.LookupUsers %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/user/searchUsers.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.user.SearchUsers %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/updateProfileBackgroundImage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.account.UpdateProfileBackgroundImage" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} 8 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/block/createBlock.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.block.CreateBlock %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/block/destroyBlock.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.block.DestroyBlock %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/getGeoDetails.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.geo.GetGeoDetails %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/reverseGeoCode.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.geo.ReverseGeoCode %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserLists.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.GetUserLists %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/showUserList.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.ShowUserList %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printFirehoseStream.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.stream.PrintFirehoseStream %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printRetweetStream.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.stream.PrintRetweetStream %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/getRetweets.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.tweets.GetRetweets %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/showStatus.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.tweets.ShowStatus %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/updateProfile.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.account.UpdateProfile %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/favorite/getFavorites.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.favorite.GetFavorites %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/geo/getSimilarPlaces.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.geo.GetSimilarPlaces %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/createUserList.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.CreateUserList %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/destroyUserList.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.DestroyUserList %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getAllUserLists.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.GetAllUserLists %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/updateUserList.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.UpdateUserList %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/stream/printRawSampleStream.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.stream.PrintRawSampleStream %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/suggestedusers/getSuggestedUserCategories.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd .. 3 | . ./setEnv.sh 4 | 5 | RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.suggestedusers.GetSuggestedUserCategories" 6 | echo $RUN_CMD ${1+"$@"} 7 | exec $RUN_CMD ${1+"$@"} -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/destroyStatus.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.tweets.DestroyStatus %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/tweets/retweetStatus.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.tweets.RetweetStatus %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-stream/src/test/resources/stallwarning.json: -------------------------------------------------------------------------------- 1 | {"warning":{"code":"FALLING_BEHIND","message":"Your connection is falling behind and messages are being queued for delivery to you. Your queue is now over 60% full. You will be disconnected when the queue is full.","percent_full": 60}} -------------------------------------------------------------------------------- /twitter4j-examples/bin/block/getBlockingUsers.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.block.GetBlockingUsers %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/getDirectMessages.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.directmessage.GetDirectMessages %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/sendDirectMessage.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.directmessage.SendDirectMessage %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/showDirectMessage.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.directmessage.ShowDirectMessage %* 8 | 9 | ENDLOCAL -------------------------------------------------------------------------------- /twitter4j-examples/bin/favorite/createFavorite.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.favorite.CreateFavorite %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/addUserListMember.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.AddUserListMember %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/addUserListMembers.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.AddUserListMembers %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListMembers.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.GetUserListMembers %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/imgLyImageUpload.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.media.ImgLyImageUpload %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/yFrogImageUpload.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.media.YFrogImageUpload %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/getAccountSettings.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.account.GetAccountSettings %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/getRateLimitStatus.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.account.GetRateLimitStatus %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/updateProfileImage.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.account.UpdateProfileImage %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/verifyCredentials.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.account.VerifyCredentials %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/block/getBlockingUsersIDs.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.block.GetBlockingUsersIDs %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/favorite/destroyFavorite.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.favorite.DestroyFavorite %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/showFriendship.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendship.ShowFriendship %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/deleteUserListMember.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.DeleteUserListMember %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListStatuses.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.GetUserListStatuses %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/twippleImageUpload.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.media.TwippleImageUpload %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/twitpicImageUpload.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.media.TwitpicImageUpload %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/trends/getAvailableTrends.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.trends.GetAvailableTrends %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/trends/getLocationTrends.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.trends.GetLocationTrends %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/updateProfileColors.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.account.UpdateProfileColors %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/createFriendship.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendship.CreateFriendship %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/destroyFriendship.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendship.DestroyFriendship %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/lookupFriendships.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendship.LookupFriendships %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/updateFriendship.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendship.UpdateFriendship %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListMemberships.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.GetUserListMemberships %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListSubscribers.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.GetUserListSubscribers %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/showUserListMembership.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.ShowUserListMembership %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/media/tweetPhotoImageUpload.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.media.TweetPhotoImageUpload %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/createUserListSubscription.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.CreateUserListSubscription %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/getUserListSubscriptions.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.GetUserListSubscriptions %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/showUserListSubscription.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.ShowUserListSubscription %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/savedsearches/createSavedSearch.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.savedsearches.CreateSavedSearch %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/savedsearches/getSavedSearches.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.savedsearches.GetSavedSearches %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/savedsearches/showSavedSearch.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.savedsearches.ShowSavedSearch %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendsandfollowers/getFriendsIDs.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendsandfollowers.GetFriendsIDs %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/getIncomingFriendships.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendship.GetIncomingFriendships %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendship/getOutgoingFriendships.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendship.GetOutgoingFriendships %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/list/destroyUserListSubscription.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.DestroyUserListSubscription %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/savedsearches/destroySavedSearch.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.savedsearches.DestroySavedSearch %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/suggestedusers/getUserSuggestions.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.suggestedusers.GetUserSuggestions %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/account/updateProfileBackgroundImage.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.account.UpdateProfileBackgroundImage %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/destroyDirectMessage.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.directmessage.DestroyDirectMessage %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/directmessage/getSentDirectMessages.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.directmessage.GetSentDirectMessages %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/friendsandfollowers/getFollowersIDs.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.friendsandfollowers.GetFollowersIDs %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/suggestedusers/getMemberSuggestions.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.suggestedusers.GetMemberSuggestions %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-media-support/src/test/resources/twitter4j.properties-template: -------------------------------------------------------------------------------- 1 | oauth.accessToken= 2 | oauth.accessTokenSecret= 3 | 4 | oauth.consumerKey= 5 | oauth.consumerSecret= 6 | 7 | media.provider=Twitpic 8 | media.providerParameters=foo=bar&fizz=bazz 9 | 10 | media.providerAPIKey=***twitpic api key*** 11 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/suggestedusers/getSuggestedUserCategories.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | SETLOCAL enabledelayedexpansion 3 | cd .. 4 | call setEnv.cmd 5 | 6 | echo on 7 | "%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.suggestedusers.GetSuggestedUserCategories %* 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseListener.java: -------------------------------------------------------------------------------- 1 | package twitter4j.internal.http; 2 | 3 | /** 4 | * @author Andrew Hedges - andrew.hedges at gmail.com 5 | */ 6 | public interface HttpResponseListener { 7 | 8 | public void httpResponseReceived(HttpResponseEvent event); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/error.json: -------------------------------------------------------------------------------- 1 | {"error":"\u3042\u306a\u305f\u3092\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u306b\u30c0\u30a4\u30ec\u30af\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002","request":"\/1\/direct_messages\/new.json"} -------------------------------------------------------------------------------- /twitter4j-stream/src/main/java/twitter4j/StreamImplementation.java: -------------------------------------------------------------------------------- 1 | package twitter4j; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * @author Yusuke Yamamoto - yusuke at mac.com 7 | * @since Twitter4J 2.1.8 8 | */ 9 | interface StreamImplementation { 10 | void next(StreamListener[] listeners, RawStreamListener[] rawStreamListeners) throws TwitterException; 11 | 12 | void close() throws IOException; 13 | 14 | void onException(Exception ex, StreamListener[] listeners, RawStreamListener[] rawStreamListeners); 15 | } 16 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/setEnv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -z $JAVA_HOME ] ; then 3 | export JAVA_HOME="/Library/Java/Home" 4 | fi 5 | 6 | for jar in ../lib/*.jar;do 7 | export CLASSPATH=$CLASSPATH:$jar 8 | done 9 | 10 | for jar in ../target/*.jar;do 11 | export CLASSPATH=$CLASSPATH:$jar 12 | done 13 | 14 | for jar in ../../twitter4j-core/target/*.jar;do 15 | export CLASSPATH=$CLASSPATH:$jar 16 | done 17 | 18 | for jar in ../../twitter4j-stream/target/*.jar;do 19 | export CLASSPATH=$CLASSPATH:$jar 20 | done 21 | 22 | export MEM_ARGS="-Xms30m -Xmx30m" -------------------------------------------------------------------------------- /readme-libs.txt: -------------------------------------------------------------------------------- 1 | Twittetr4J is a Twitter API binding library for the Java language licensed under Apache License 2.0. 2 | 3 | Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html 4 | 5 | readme-libs.txt - this file 6 | twitter4j-core.jar - REST and Search API support 7 | twitter4j-async.jar - Async API support : use with twitter4j-core 8 | twitter4j-media-support.jar - media API support : use with twitter4j-core 9 | twitter4j-stream.jar - Streaming API support : use with twitter4j-core 10 | twitter4j-examples.jar - examples : use with twitter4j-core, twitter4j-async and twitter4j-stream -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/Place.java: -------------------------------------------------------------------------------- 1 | package twitter4j; 2 | 3 | /** 4 | * @author Yusuke Yamamoto - yusuke at mac.com 5 | * @since Twitter4J 2.1.1 6 | */ 7 | public interface Place extends TwitterResponse, Comparable, java.io.Serializable { 8 | String getName(); 9 | 10 | String getStreetAddress(); 11 | 12 | String getCountryCode(); 13 | 14 | String getId(); 15 | 16 | String getCountry(); 17 | 18 | String getPlaceType(); 19 | 20 | String getURL(); 21 | 22 | String getFullName(); 23 | 24 | String getBoundingBoxType(); 25 | 26 | GeoLocation[][] getBoundingBoxCoordinates(); 27 | 28 | String getGeometryType(); 29 | 30 | GeoLocation[][] getGeometryCoordinates(); 31 | 32 | Place[] getContainedWithIn(); 33 | } 34 | -------------------------------------------------------------------------------- /powered-by-badge/readme-ja.txt: -------------------------------------------------------------------------------- 1 | Twitter4J を使ったアプリケーション、サービスでは任意で以下のバッジを使用することができます。バッジのライセンスは BSD です。リンクする場合は "http://twitter4j.org/" へリンクして頂くようお願いいたします。。 2 | 3 | HTML コード例: 4 | PNG: 5 | - 枠無し 6 | 7 | 8 | - 枠有り 9 | 10 | 11 | 12 | GIF: 13 | - 枠無し 14 | 15 | 16 | - 枠有り 17 | 18 | 19 | -------------------------------------------------------------------------------- /powered-by-badge/readme.txt: -------------------------------------------------------------------------------- 1 | Any service, aplication using Twitter4J can embed the following BSD licensed "powered by" logo. It is suggested to link the badge to "http://twitter4j.org/" without "en/". 2 | 3 | HTML code snippets: 4 | PNG: 5 | - borderless 6 | 7 | 8 | - without border 9 | 10 | 11 | 12 | GIF: 13 | - borderless 14 | 15 | 16 | - with border 17 | 18 | 19 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/http/RequestMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.http; 18 | 19 | /** 20 | * @author Dan Checkoway - dcheckoway at gmail.com 21 | */ 22 | public enum RequestMethod { 23 | GET, POST, DELETE, HEAD, PUT 24 | } 25 | -------------------------------------------------------------------------------- /twitter4j-stream/src/main/java/twitter4j/StreamListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.8 22 | */ 23 | interface StreamListener { 24 | void onException(Exception ex); 25 | } 26 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/org/json/JSONException.java: -------------------------------------------------------------------------------- 1 | package twitter4j.internal.org.json; 2 | 3 | /** 4 | * The JSONException is thrown by the JSON.org classes when things are amiss. 5 | * 6 | * @author JSON.org 7 | * @version 2010-12-24 8 | */ 9 | public class JSONException extends Exception { 10 | private static final long serialVersionUID = 0; 11 | private Throwable cause; 12 | 13 | /** 14 | * Constructs a JSONException with an explanatory message. 15 | * 16 | * @param message Detail about the reason for the exception. 17 | */ 18 | public JSONException(String message) { 19 | super(message); 20 | } 21 | 22 | public JSONException(Throwable cause) { 23 | super(cause.getMessage()); 24 | this.cause = cause; 25 | } 26 | 27 | public Throwable getCause() { 28 | return this.cause; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/async/Dispatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.async; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public interface Dispatcher { 23 | 24 | void invokeLater(Runnable task); 25 | 26 | void shutdown(); 27 | } 28 | -------------------------------------------------------------------------------- /twitter4j-stream/src/main/java/twitter4j/RawStreamListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | /** 19 | * @author Yusuke Yamamoto - yusuke at mac.com 20 | * @since Twitter4J 3.0.2 21 | */ 22 | public interface RawStreamListener extends StreamListener { 23 | void onMessage(String rawString); 24 | } 25 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/Category.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.1 22 | */ 23 | public interface Category { 24 | String getName(); 25 | 26 | String getSlug(); 27 | 28 | int getSize(); 29 | } 30 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/TimeZone.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Alessandro Bahgat - ale.bahgat at gmail.com 21 | */ 22 | public interface TimeZone extends java.io.Serializable { 23 | String getName(); 24 | 25 | String tzinfoName(); 26 | 27 | int utcOffset(); 28 | } -------------------------------------------------------------------------------- /twitter4j-stream/src/test/resources/dao/suggestions.json: -------------------------------------------------------------------------------- 1 | [{"slug":"art-design","size":56,"name":"Art & Design"},{"slug":"books","size":72,"name":"Books"},{"slug":"business","size":65,"name":"Business"},{"slug":"charity","size":83,"name":"Charity"},{"slug":"deals-discounts","size":32,"name":"Deals & Discounts"},{"slug":"entertainment","size":126,"name":"Entertainment"},{"slug":"family","size":55,"name":"Family"},{"slug":"fashion","size":56,"name":"Fashion"},{"slug":"food-drink","size":81,"name":"Food & Drink"},{"slug":"funny","size":69,"name":"Funny"},{"slug":"health","size":51,"name":"Health"},{"slug":"music","size":119,"name":"Music"},{"slug":"news","size":59,"name":"News"},{"slug":"politics","size":81,"name":"Politics"},{"slug":"science","size":54,"name":"Science"},{"slug":"sports","size":116,"name":"Sports"},{"slug":"staff-picks","size":96,"name":"Staff Picks"},{"slug":"technology","size":60,"name":"Technology"},{"slug":"travel","size":56,"name":"Travel"},{"slug":"twitter","size":16,"name":"Twitter"}] -------------------------------------------------------------------------------- /twitter4j-media-support/src/main/java/twitter4j/media/MediaProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.media; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.8 22 | */ 23 | public enum MediaProvider { 24 | TWITTER, IMG_LY, PLIXI, LOCKERZ, TWIPPLE, TWITGOO, TWITPIC, YFROG, MOBYPICTURE, POSTEROUS 25 | } -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapperConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.http; 18 | 19 | import java.util.Map; 20 | 21 | public interface HttpClientWrapperConfiguration extends HttpClientConfiguration { 22 | /** 23 | * @return request headers 24 | */ 25 | Map getRequestHeaders(); 26 | } 27 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/Friendship.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.9 22 | */ 23 | public interface Friendship extends java.io.Serializable { 24 | long getId(); 25 | 26 | String getName(); 27 | 28 | String getScreenName(); 29 | 30 | boolean isFollowing(); 31 | 32 | boolean isFollowedBy(); 33 | } 34 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/ResponseList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | import java.util.List; 20 | 21 | 22 | /** 23 | * List of TwitterResponse. 24 | * 25 | * @author Yusuke Yamamoto - yusuke at mac.com 26 | */ 27 | public interface ResponseList extends TwitterResponse, List { 28 | 29 | /** 30 | * {@inheritDoc} 31 | */ 32 | public RateLimitStatus getRateLimitStatus(); 33 | } 34 | -------------------------------------------------------------------------------- /twitter4j-appengine/src/main/java/twitter4j/TwitterRuntimeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | /** 19 | * @author Yusuke Yamamoto - yusuke at mac.com 20 | * @since Twitter4J 2.2.4 21 | */ 22 | public class TwitterRuntimeException extends RuntimeException { 23 | private static final long serialVersionUID = 4476620514268902834L; 24 | 25 | public TwitterRuntimeException(Throwable th) { 26 | super(th); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/http/HttpClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.http; 18 | 19 | import twitter4j.TwitterException; 20 | 21 | /** 22 | * A utility class to handle HTTP request/response. 23 | * 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | */ 26 | public interface HttpClient { 27 | 28 | HttpResponse request(HttpRequest req) throws TwitterException; 29 | 30 | void shutdown(); 31 | } 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | statuses/* 2 | target/* 3 | /twitter4j.properties 4 | twitter4j-httpclient-support/target/* 5 | twitter4j-media-support/target/* 6 | twitter4j-all/target/* 7 | twitter4j-core/target/* 8 | twitter4j-core/src/test/resources/xauth-test.properties 9 | twitter4j-core/src/test/resources/sitestream-test.properties 10 | twitter4j-core/src/test/resources/test.properties 11 | twitter4j-appengine/src/test/resources/twitter4j.properties 12 | twitter4j-appengine/target/* 13 | twitter4j-stream/target/* 14 | twitter4j-stream/src/test/resources/test.properties 15 | twitter4j-stream/src/test/resources/sitestream-test.properties 16 | twitter4j-async/target/* 17 | twitter4j-async/src/test/resources/test.properties 18 | twitter4j-media-support/src/test/resources/twitter4j.properties 19 | twitter4j-httpclient-support/src/test/resources/twitter4j.properties 20 | twitter4j-examples/src/main/resources/twitter4j.properties 21 | twitter4j-examples/target/* 22 | .DS_Store 23 | ~$* 24 | .classpath 25 | .project 26 | .settings 27 | reports/* 28 | atlassian-ide-plugin.xml 29 | *.iml 30 | *.ipr 31 | *.iws 32 | .idea/* 33 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/logging/JULLoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j.internal.logging; 17 | 18 | /** 19 | * @author Yusuke Yamamoto - yusuke at mac.com 20 | * @since Twitter4J 2.2.4 21 | */ 22 | final class JULLoggerFactory extends LoggerFactory { 23 | @Override 24 | public Logger getLogger(Class clazz) { 25 | return new JULLogger(java.util.logging.Logger.getLogger(clazz.getName())); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /twitter4j-core/src/test/java/twitter4j/SSLTestUnit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public class SSLTestUnit extends TwitterTest { 23 | public SSLTestUnit(String name) { 24 | super(name); 25 | } 26 | 27 | protected void setUp() throws Exception { 28 | System.setProperty("twitter4j.http.useSSL", "true"); 29 | super.setUp(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /twitter4j-stream/src/test/resources/dao/3c6797665e2d42eb.json: -------------------------------------------------------------------------------- 1 | {"bounding_box":{"type":"Polygon","coordinates":[[[-122.421137,37.756431],[-122.421137,37.756431],[-122.421137,37.756431],[-122.421137,37.756431]]]},"contained_within":[{"bounding_box":{"type":"Polygon","coordinates":[[[-122.51368188,37.70813196],[-122.35845384,37.70813196],[-122.35845384,37.83245301],[-122.51368188,37.83245301]]]},"country":"The United States of America","attributes":{},"full_name":"San Francisco, CA","name":"San Francisco","country_code":"US","id":"5a110d312052166f","place_type":"city","url":"http://api.twitter.com/1/geo/id/5a110d312052166f.json"}],"country":"The United States of America","polylines":[],"attributes":{"postal_code":"94110","street_address":"1026 Valencia St","162830:id":"140074788","174368:id":"840061000236015","phone":"(415) 641-1024","623:id":"11559"},"full_name":"Ritual Coffee Roasters, San Francisco","name":"Ritual Coffee Roasters","geometry":{"type":"Point","coordinates":[-122.421137,37.756431]},"country_code":"US","id":"3c6797665e2d42eb","place_type":"poi","url":"http://api.twitter.com/1/geo/id/3c6797665e2d42eb.json"} -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/Location.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public interface Location extends java.io.Serializable { 23 | int getWoeid(); 24 | 25 | String getCountryName(); 26 | 27 | String getCountryCode(); 28 | 29 | String getPlaceName(); 30 | 31 | int getPlaceCode(); 32 | 33 | String getName(); 34 | 35 | String getURL(); 36 | } 37 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/PagableResponseList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * ResponseList with cursor support. 21 | * 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | */ 24 | public interface PagableResponseList extends ResponseList, CursorSupport { 25 | boolean hasPrevious(); 26 | 27 | long getPreviousCursor(); 28 | 29 | boolean hasNext(); 30 | 31 | long getNextCursor(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/IDs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | 20 | /** 21 | * A data interface representing array of numeric IDs. 22 | * 23 | * @author Yusuke Yamamoto - yusuke at mac.com 24 | */ 25 | public interface IDs extends TwitterResponse, CursorSupport, java.io.Serializable { 26 | long[] getIDs(); 27 | 28 | boolean hasPrevious(); 29 | 30 | long getPreviousCursor(); 31 | 32 | boolean hasNext(); 33 | 34 | long getNextCursor(); 35 | } 36 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/management/InvocationStatistics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j.management; 17 | 18 | /** 19 | * @author Nick Dellamaggiore (nick.dellamaggiore gmail.com) 20 | */ 21 | public interface InvocationStatistics { 22 | public String getName(); 23 | 24 | public long getCallCount(); 25 | 26 | public long getErrorCount(); 27 | 28 | public long getTotalTime(); 29 | 30 | public long getAverageTime(); 31 | 32 | public void reset(); 33 | } 34 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.logging; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.1 22 | */ 23 | final class Log4JLoggerFactory extends LoggerFactory { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public Logger getLogger(Class clazz) { 30 | return new Log4JLogger(org.apache.log4j.Logger.getLogger(clazz)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/logging/LoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.logging; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.1 22 | */ 23 | public abstract class LoggerFactory { 24 | 25 | /** 26 | * Returns a logger associated with the specified class. 27 | * 28 | * @param clazz class 29 | * @return a logger instance 30 | */ 31 | public abstract Logger getLogger(Class clazz); 32 | } 33 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.logging; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.1 22 | */ 23 | final class SLF4JLoggerFactory extends LoggerFactory { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public Logger getLogger(Class clazz) { 30 | return new SLF4JLogger(org.slf4j.LoggerFactory.getLogger(clazz)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/Trend.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | 20 | /** 21 | * A data interface representing Trend. 22 | * 23 | * @author Yusuke Yamamoto - yusuke at mac.com 24 | * @since Twitter4J 2.0.2 25 | */ 26 | public interface Trend extends java.io.Serializable { 27 | String getName(); 28 | 29 | /** 30 | * @deprecated use {@link #getURL()} instead 31 | */ 32 | String getUrl(); 33 | 34 | String getURL(); 35 | 36 | String getQuery(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/logging/NullLoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.logging; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.4 22 | */ 23 | final class NullLoggerFactory extends LoggerFactory { 24 | private static final Logger SINGLETON = new NullLogger(); 25 | 26 | /** 27 | * {@inheritDoc} 28 | */ 29 | @Override 30 | public Logger getLogger(Class clazz) { 31 | return SINGLETON; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/logging/StdOutLoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.logging; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.1 22 | */ 23 | final class StdOutLoggerFactory extends LoggerFactory { 24 | private static final Logger SINGLETON = new StdOutLogger(); 25 | 26 | /** 27 | * {@inheritDoc} 28 | */ 29 | @Override 30 | public Logger getLogger(Class clazz) { 31 | return SINGLETON; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.logging; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.1 22 | */ 23 | final class CommonsLoggingLoggerFactory extends LoggerFactory { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public Logger getLogger(Class clazz) { 30 | return new CommonsLoggingLogger(org.apache.commons.logging.LogFactory.getLog(clazz)); 31 | } 32 | } -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/SavedSearch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | import java.util.Date; 20 | 21 | /** 22 | * A data interface representing a Saved Search 23 | * 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | * @since Twitter4J 2.0.8 26 | */ 27 | public interface SavedSearch extends Comparable, TwitterResponse, java.io.Serializable { 28 | Date getCreatedAt(); 29 | 30 | String getQuery(); 31 | 32 | int getPosition(); 33 | 34 | String getName(); 35 | 36 | int getId(); 37 | 38 | } -------------------------------------------------------------------------------- /twitter4j-appengine/src/test/resources/generate-lazy-objects.sh: -------------------------------------------------------------------------------- 1 | ./generate-lazy-object.sh AccountSettings 2 | ./generate-lazy-object.sh AccountTotals 3 | #./generate-lazy-object.sh Category 4 | ./generate-lazy-object.sh DirectMessage 5 | #./generate-lazy-object.sh HashtagEntity 6 | ./generate-lazy-object.sh IDs 7 | #./generate-lazy-object.sh MediaEntity 8 | #./generate-lazy-object.sh Paging 9 | ./generate-lazy-object.sh Place 10 | ./generate-lazy-object.sh RateLimitStatus 11 | ./generate-lazy-object.sh RelatedResults 12 | ./generate-lazy-object.sh Relationship 13 | ./generate-lazy-object.sh SavedSearch 14 | #./generate-lazy-object.sh SimilarPlaces 15 | ./generate-lazy-object.sh Status 16 | #./generate-lazy-object.sh TimeZone 17 | #./generate-lazy-object.sh Trend 18 | ./generate-lazy-object.sh Trends 19 | #./generate-lazy-object.sh Tweet 20 | ./generate-lazy-object.sh TwitterAPIConfiguration 21 | #./generate-lazy-object.sh URLEntity 22 | ./generate-lazy-object.sh User 23 | ./generate-lazy-object.sh UserList 24 | sed -i "" "s/target = factory.createUserList(res);/target = factory.createAUserList(res);/g" ../../main/java/twitter4j/internal/json/LazyUserList.java 25 | 26 | #./generate-lazy-object.sh UserMentionEntity 27 | 28 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/auth/AuthorizationConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.auth; 18 | 19 | /** 20 | * A static factory class for Authorization. 21 | * 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @since Twitter4J 2.1.1 24 | */ 25 | public interface AuthorizationConfiguration { 26 | 27 | String getUser(); 28 | 29 | String getPassword(); 30 | 31 | String getOAuthConsumerKey(); 32 | 33 | String getOAuthConsumerSecret(); 34 | 35 | String getOAuthAccessToken(); 36 | 37 | String getOAuthAccessTokenSecret(); 38 | } 39 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/ConnectionLifeCycleListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.7 22 | */ 23 | public interface ConnectionLifeCycleListener { 24 | /** 25 | * called after connection was established 26 | */ 27 | void onConnect(); 28 | 29 | /** 30 | * called after connection was disconnected 31 | */ 32 | void onDisconnect(); 33 | 34 | /** 35 | * called before thread gets cleaned up 36 | */ 37 | void onCleanUp(); 38 | } 39 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/auth/Authorization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.auth; 18 | 19 | import twitter4j.internal.http.HttpRequest; 20 | 21 | /** 22 | * An interface represents credentials. 23 | * 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | */ 26 | public interface Authorization extends java.io.Serializable { 27 | String getAuthorizationHeader(HttpRequest req); 28 | 29 | /** 30 | * Returns true if authorization credentials are set. 31 | * 32 | * @return true if authorization credentials are set 33 | */ 34 | boolean isEnabled(); 35 | } -------------------------------------------------------------------------------- /twitter4j-stream/src/test/resources/dao/5a110d312052166f.json: -------------------------------------------------------------------------------- 1 | {"country":"","bounding_box":{"type":"Polygon","coordinates":[[[-122.51368188,37.70813196],[-122.35845384,37.70813196],[-122.35845384,37.83245301],[-122.51368188,37.83245301]]]},"contained_within":[{"country":"","bounding_box":{"type":"Polygon","coordinates":[[[-124.482003,32.528832],[-114.131211,32.528832],[-114.131211,42.009517],[-124.482003,42.009517]]]},"place_type":"admin","country_code":"US","full_name":"California","name":"California","id":"fbd6d2f5a4e4a15e","url":"http://api.twitter.com/1/geo/id/fbd6d2f5a4e4a15e.json"}],"place_type":"city","geometry":{"type":"Polygon","coordinates":[[[-122.46628284,37.70813196],[-122.48948304,37.712232],[-122.497983,37.71713196],[-122.49978012,37.71960696],[-122.50787796,37.73529],[-122.51368188,37.77856803],[-122.51305692,37.78252398],[-122.47808292,37.81082799],[-122.37322716,37.83245301],[-122.36652288,37.83081303],[-122.35845384,37.81450503],[-122.377842,37.72782],[-122.38322616,37.70940303],[-122.39378208,37.70823096],[-122.46628284,37.70813196]]]},"polylines":["yzceFfenjVsX~oCs]bt@oNfJ_aBrq@omGfc@uW{B}oDsyEcfCinSfI}h@zdBmq@x|OdxBbrBt`@hF|`ARbdM"],"country_code":"US","full_name":"San Francisco","name":"San Francisco","id":"5a110d312052166f","url":"http://api.twitter.com/1/geo/id/5a110d312052166f.json"} -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/TwitterAPIConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | import java.io.Serializable; 19 | import java.util.Map; 20 | 21 | /** 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @since Twitter4J 2.2.3 24 | */ 25 | public interface TwitterAPIConfiguration extends TwitterResponse, Serializable { 26 | int getPhotoSizeLimit(); 27 | 28 | int getShortURLLength(); 29 | 30 | int getShortURLLengthHttps(); 31 | 32 | int getCharactersReservedPerMedia(); 33 | 34 | Map getPhotoSizes(); 35 | 36 | String[] getNonUsernamePaths(); 37 | 38 | int getMaxMediaPerUpload(); 39 | } 40 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/SimilarPlaces.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.7 22 | */ 23 | public interface SimilarPlaces extends ResponseList { 24 | /** 25 | * Returns the token needed to be able to create a new place with {@link twitter4j.api.PlacesGeoResources#createPlace(String, String, String, GeoLocation, String)}. 26 | * 27 | * @return token the token needed to be able to create a new place with {@link twitter4j.api.PlacesGeoResources#createPlace(String, String, String, GeoLocation, String)} 28 | */ 29 | String getToken(); 30 | } 31 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/CursorSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public interface CursorSupport { 23 | /** 24 | * @since Twitter4J 2.2.3 25 | */ 26 | long START = -1L; 27 | 28 | /** 29 | * @since Twitter4J 2.0.10 30 | */ 31 | boolean hasPrevious(); 32 | 33 | /** 34 | * @since Twitter4J 2.0.10 35 | */ 36 | long getPreviousCursor(); 37 | 38 | /** 39 | * @since Twitter4J 2.0.10 40 | */ 41 | boolean hasNext(); 42 | 43 | /** 44 | * @since Twitter4J 2.0.10 45 | */ 46 | long getNextCursor(); 47 | } 48 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/SymbolEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | import java.io.Serializable; 19 | 20 | /** 21 | * @author Yusuke Yamamoto - yusuke at mac.com 22 | * @since Twitter4J 3.0.4 23 | */ 24 | public interface SymbolEntity extends TweetEntity, Serializable { 25 | /** 26 | * Returns the index of the start character of the symbol. 27 | * 28 | * @return the index of the start character of the symbol 29 | */ 30 | int getStart(); 31 | 32 | /** 33 | * Returns the index of the end character of the symbol. 34 | * 35 | * @return the index of the end character of the symbol 36 | */ 37 | int getEnd(); 38 | } 39 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/StatusDeletionNotice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | 20 | /** 21 | * A data class representing Status deletionNotice
22 | * Clients are urged to honor deletionNotice requests and discard deleted statuses immediately. At times, status deletionNotice messages may arrive before the status. Even in this case, the late arriving status should be deleted from your backing store. 23 | * 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | * @since Twitter4J 2.1.0 26 | */ 27 | public interface StatusDeletionNotice extends Comparable, java.io.Serializable { 28 | long getStatusId(); 29 | 30 | long getUserId(); 31 | } 32 | -------------------------------------------------------------------------------- /twitter4j-stream/src/main/java/twitter4j/StatusStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @since Twitter4J 2.0.4 24 | */ 25 | public interface StatusStream { 26 | 27 | /** 28 | * Reads next status from this stream. 29 | * 30 | * @param listener a StatusListener implementation 31 | * @throws TwitterException when the end of the stream has been reached. 32 | * @throws IllegalStateException when the end of the stream had been reached. 33 | */ 34 | void next(StatusListener listener) throws TwitterException; 35 | 36 | void close() throws IOException; 37 | } 38 | -------------------------------------------------------------------------------- /twitter4j-stream/src/main/java/twitter4j/UserStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @since Twitter4J 2.1.3 24 | */ 25 | public interface UserStream extends StatusStream { 26 | /** 27 | * Reads next element from this stream. 28 | * 29 | * @param listener a UserStreamListener implementation 30 | * @throws TwitterException when the end of the stream has been reached. 31 | * @throws IllegalStateException when the end of the stream had been reached. 32 | */ 33 | void next(UserStreamListener listener) throws TwitterException; 34 | 35 | void close() throws IOException; 36 | } 37 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public final class Version { 23 | private static final String VERSION = "3.0.4-SNAPSHOT"; 24 | private static final String TITLE = "Twitter4J"; 25 | 26 | private Version() { 27 | throw new AssertionError(); 28 | } 29 | 30 | public static String getVersion() { 31 | return VERSION; 32 | } 33 | 34 | /** 35 | * prints the version string 36 | * 37 | * @param args will be just ignored. 38 | */ 39 | public static void main(String[] args) { 40 | System.out.println(TITLE + " " + VERSION); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/conf/ConfigurationFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.conf; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public interface ConfigurationFactory { 23 | /** 24 | * returns the root configuration 25 | * 26 | * @return root configuration 27 | */ 28 | Configuration getInstance(); 29 | 30 | /** 31 | * returns the configuration specified by the path 32 | * 33 | * @param configTreePath the path 34 | * @return the configuratoin 35 | */ 36 | Configuration getInstance(String configTreePath); 37 | 38 | /** 39 | * clean up resources acquired by this factory. 40 | */ 41 | void dispose(); 42 | } 43 | -------------------------------------------------------------------------------- /twitter4j-appengine/src/main/java/twitter4j/AppEngineTwitterImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | import twitter4j.auth.Authorization; 19 | import twitter4j.conf.Configuration; 20 | import twitter4j.internal.json.z_T4JInternalLazyFactory; 21 | 22 | /** 23 | * @author Yusuke Yamamoto - yusuke at mac.com 24 | * @since Twitter4J 2.2.4 25 | */ 26 | class AppEngineTwitterImpl extends TwitterImpl { 27 | private static final long serialVersionUID = -2740925801854937207L; 28 | 29 | AppEngineTwitterImpl(Configuration conf, Authorization auth) { 30 | super(conf, auth); 31 | } 32 | 33 | @Override 34 | protected void setFactory() { 35 | factory = new z_T4JInternalLazyFactory(conf); 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /twitter4j-async/src/main/java/twitter4j/api/SearchResourceAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.api; 18 | 19 | import twitter4j.Query; 20 | 21 | /** 22 | * @author Joern Huxhorn - jhuxhorn at googlemail.com 23 | */ 24 | public interface SearchResourceAsync { 25 | /** 26 | * Returns tweets that match a specified query. 27 | *
This method calls http://search.twitter.com/search.json 28 | * 29 | * @param query - the search condition 30 | * @see GET search | Twitter Developers 31 | * @see Twitter API / Search Operators 32 | * @since Twitter4J 1.1.7 33 | */ 34 | void search(Query query); 35 | } 36 | -------------------------------------------------------------------------------- /twitter4j-async/src/main/java/twitter4j/VersionAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public final class VersionAsync { 23 | private static final String VERSION = "3.0.4-SNAPSHOT"; 24 | private static final String TITLE = "Twitter4J Async API"; 25 | 26 | private VersionAsync() { 27 | throw new AssertionError(); 28 | } 29 | 30 | public static String getVersion() { 31 | return VERSION; 32 | } 33 | 34 | /** 35 | * prints the version string 36 | * 37 | * @param args will be just ignored. 38 | */ 39 | public static void main(String[] args) { 40 | System.out.println(TITLE + " " + VERSION); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/RateLimitStatusListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Andrew Hedges - andrew.hedges at gmail.com 21 | */ 22 | public interface RateLimitStatusListener { 23 | 24 | /** 25 | * Called when the response contains rate limit status. 26 | * 27 | * @param event rate limit status event. 28 | */ 29 | public void onRateLimitStatus(RateLimitStatusEvent event); 30 | 31 | /** 32 | * Called when the account or IP address is hitting the rate limit.
33 | * onRateLimitStatus will be also called before this event. 34 | * 35 | * @param event rate limit status event. 36 | */ 37 | public void onRateLimitReached(RateLimitStatusEvent event); 38 | } 39 | -------------------------------------------------------------------------------- /twitter4j-examples/bin/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ./twitter4j.log 4 | false 5 | 6 | twitter4j.%d{yyyy-MM-dd}.log 7 | 8 | 1 9 | 10 10 | 13 | true 14 | 15 | %d{HH:mm:ss} [%thread] %-5level %logger %msg%n 16 | 17 | 18 | 19 | 21 | 22 | %d{HH:mm:ss} [%thread] %-5level %logger %msg%n 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/management/APIStatisticsMBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j.management; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * Simple MBean interface for APIStatistics. Method-level statistics are exposed 22 | * as a Map of formatted strings 23 | * 24 | * @author Nick Dellamaggiore (nick.dellamaggiore gmail.com) 25 | * @see APIStatisticsOpenMBean for a dynamic version of this mbean with tabular representation 26 | */ 27 | public interface APIStatisticsMBean extends InvocationStatistics { 28 | public Map getMethodLevelSummariesAsString(); 29 | 30 | public String getMethodLevelSummary(String methodName); 31 | 32 | public Iterable getInvocationStatistics(); 33 | } 34 | -------------------------------------------------------------------------------- /twitter4j-media-support/src/main/java/twitter4j/media/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.media; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public final class Version { 23 | private static final String VERSION = "3.0.4-SNAPSHOT"; 24 | private static final String TITLE = "Twitter4J Media support"; 25 | 26 | private Version() { 27 | throw new AssertionError(); 28 | } 29 | 30 | public static String getVersion() { 31 | return VERSION; 32 | } 33 | 34 | /** 35 | * prints the version string 36 | * 37 | * @param args will be just ignored. 38 | */ 39 | public static void main(String[] args) { 40 | System.out.println(TITLE + " " + VERSION); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.http; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public interface HttpClientConfiguration { 23 | 24 | String getHttpProxyHost(); 25 | 26 | int getHttpProxyPort(); 27 | 28 | String getHttpProxyUser(); 29 | 30 | String getHttpProxyPassword(); 31 | 32 | int getHttpConnectionTimeout(); 33 | 34 | int getHttpReadTimeout(); 35 | 36 | int getHttpRetryCount(); 37 | 38 | int getHttpRetryIntervalSeconds(); 39 | 40 | int getHttpMaxTotalConnections(); 41 | 42 | int getHttpDefaultMaxPerRoute(); 43 | 44 | boolean isPrettyDebugEnabled(); 45 | 46 | boolean isGZIPEnabled(); 47 | } 48 | -------------------------------------------------------------------------------- /twitter4j-stream/src/main/java/twitter4j/VersionStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | public final class VersionStream { 23 | private static final String VERSION = "3.0.4-SNAPSHOT"; 24 | private static final String TITLE = "Twitter4J Streaming API support"; 25 | 26 | private VersionStream() { 27 | throw new AssertionError(); 28 | } 29 | 30 | public static String getVersion() { 31 | return VERSION; 32 | } 33 | 34 | /** 35 | * prints the version string 36 | * 37 | * @param args will be just ignored. 38 | */ 39 | public static void main(String[] args) { 40 | System.out.println(TITLE + " " + VERSION); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /twitter4j-stream/src/test/resources/dao/user.json: -------------------------------------------------------------------------------- 1 | {"statuses_count":10696,"profile_sidebar_border_color":"87bc44","description":"Hi there, I do test a lot!new","screen_name":"twit4j","show_all_inline_media":false,"lang":"en","profile_use_background_image":true,"time_zone":"Alaska","created_at":"Sun May 27 09:52:09 +0000 2007","friends_count":3,"location":"location:","status":{"in_reply_to_screen_name":null,"in_reply_to_status_id":null,"in_reply_to_user_id":null,"created_at":"Sat Aug 28 05:47:13 +0000 2010","retweet_count":null,"truncated":false,"source":"Twitter4J","place":null,"contributors":null,"geo":null,"retweeted":false,"coordinates":null,"favorited":false,"id":22331311794,"text":"Sat Aug 28 17:47:13 NZST 2010: test"},"contributors_enabled":false,"profile_background_image_url":"http://a1.twimg.com/profile_background_images/141117382/t4j-reverse.png","favourites_count":0,"profile_background_color":"9ae4e8","following":false,"geo_enabled":true,"profile_background_tile":false,"profile_text_color":"000000","follow_request_sent":false,"verified":false,"profile_link_color":"0000ff","protected":false,"notifications":false,"name":"twit4j","profile_sidebar_fill_color":"e0ff92","profile_image_url":"http://a3.twimg.com/profile_images/1112344203/t4j_normal.jpeg","id":6358482,"listed_count":2,"utc_offset":-32400,"followers_count":22,"url":"http://yusuke.homeip.net/twitter4j/"} -------------------------------------------------------------------------------- /twitter4j-core/src/test/resources/test.properties-template: -------------------------------------------------------------------------------- 1 | id1.user= 2 | id1.password= 3 | id1.id= 4 | id1.oauth.accessToken= 5 | id1.oauth.accessTokenSecret= 6 | 7 | id2.user= 8 | id2.password= 9 | id2.id= 10 | id2.oauth.accessToken= 11 | id2.oauth.accessTokenSecret= 12 | 13 | # a protected user 14 | id3.user= 15 | id3.password= 16 | id3.id= 17 | id3.oauth.accessToken= 18 | id3.oauth.accessTokenSecret= 19 | id3.oauth.consumerKey= 20 | id3.oauth.consumerSecret= 21 | 22 | 23 | # a user who's screen name consists of numbers 24 | numberid.user= 25 | numberid.password= 26 | numberid.id= 27 | 28 | followsOneWay= 29 | # followsOneWay follows id1 for sure 30 | followsOneWaypass= 31 | 32 | # bestFriend1 and bestFriend2 are following each other 33 | bestFriend1.user= 34 | bestFriend1.password= 35 | bestFriend1.id= 36 | bestFriend1.oauth.accessToken= 37 | bestFriend1.oauth.accessTokenSecret= 38 | 39 | bestFriend2.user= 40 | bestFriend2.password= 41 | bestFriend2.id= 42 | bestFriend2.oauth.accessToken= 43 | bestFriend2.oauth.accessTokenSecret= 44 | 45 | 46 | oauth.consumerKey= 47 | oauth.consumerSecret= 48 | browser.oauth.consumerKey= 49 | browser.oauth.consumerSecret= 50 | 51 | r-w-private.oauth.consumerKey= 52 | r-w-private.oauth.consumerSecret= 53 | r-w-private.oauth.accessToken= 54 | r-w-private.oauth.accessTokenSecret= 55 | 56 | twitpic.apiKey= 57 | tweetPhoto.apiKey= 58 | 59 | http.prettyDebug=true 60 | jsonStoreEnabled=true 61 | mbeanEnabled=true -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/DirectMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | import java.util.Date; 20 | 21 | /** 22 | * A data interface representing sent/received direct message. 23 | * 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | */ 26 | public interface DirectMessage extends TwitterResponse, EntitySupport, java.io.Serializable { 27 | 28 | long getId(); 29 | 30 | String getText(); 31 | 32 | long getSenderId(); 33 | 34 | long getRecipientId(); 35 | 36 | /** 37 | * @return created_at 38 | * @since Twitter4J 1.1.0 39 | */ 40 | Date getCreatedAt(); 41 | 42 | String getSenderScreenName(); 43 | 44 | String getRecipientScreenName(); 45 | 46 | 47 | User getSender(); 48 | 49 | 50 | User getRecipient(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /twitter4j-appengine/src/main/java/twitter4j/VersionAppEngine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Takao Nakaguchi - takao.nakaguchi at gmail.com 21 | * @since Twitter4J 2.2.4 22 | */ 23 | public final class VersionAppEngine { 24 | private static final String VERSION = "3.0.4-SNAPSHOT"; 25 | private static final String TITLE = "Twitter4J App Engine Support"; 26 | 27 | private VersionAppEngine() { 28 | throw new AssertionError(); 29 | } 30 | 31 | public static String getVersion() { 32 | return VERSION; 33 | } 34 | 35 | /** 36 | * prints the version string 37 | * 38 | * @param args will be just ignored. 39 | */ 40 | public static void main(String[] args) { 41 | System.out.println(TITLE + " " + VERSION); 42 | } 43 | } -------------------------------------------------------------------------------- /twitter4j-media-support/src/main/java/twitter4j/media/ImageUpload.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.media; 18 | 19 | import twitter4j.TwitterException; 20 | 21 | import java.io.File; 22 | import java.io.InputStream; 23 | 24 | /** 25 | * @author Rémy Rakic - remy.rakic at gmail.com 26 | * @author Takao Nakaguchi - takao.nakaguchi at gmail.com 27 | * @author withgod - noname at withgod.jp 28 | * @since Twitter4J 2.1.8 29 | */ 30 | public interface ImageUpload { 31 | String upload(File image, String message) throws TwitterException; 32 | 33 | String upload(File image) throws TwitterException; 34 | 35 | String upload(String imageFileName, InputStream imageBody) throws TwitterException; 36 | 37 | String upload(String imageFileName, InputStream imageBody, String message) throws TwitterException; 38 | } 39 | -------------------------------------------------------------------------------- /twitter4j-stream/src/main/java/twitter4j/StatusAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author yusuke at mac.com 21 | * @since Twitter4J 2.1.3 22 | */ 23 | public class StatusAdapter implements StatusListener { 24 | @Override 25 | public void onStatus(Status status) { 26 | } 27 | 28 | @Override 29 | public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) { 30 | } 31 | 32 | @Override 33 | public void onTrackLimitationNotice(int numberOfLimitedStatuses) { 34 | } 35 | 36 | @Override 37 | public void onScrubGeo(long userId, long upToStatusId) { 38 | } 39 | 40 | @Override 41 | public void onException(Exception ex) { 42 | } 43 | 44 | @Override 45 | public void onStallWarning(StallWarning warning) { 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/Twitter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | import twitter4j.api.*; 19 | import twitter4j.auth.OAuthSupport; 20 | 21 | /** 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @since Twitter4J 2.2.0 24 | */ 25 | public interface Twitter extends java.io.Serializable, 26 | OAuthSupport, 27 | TwitterBase, 28 | TimelinesResources, 29 | TweetsResources, 30 | SearchResource, 31 | DirectMessagesResources, 32 | FriendsFollowersResources, 33 | UsersResources, 34 | SuggestedUsersResources, 35 | FavoritesResources, 36 | ListsResources, 37 | SavedSearchesResources, 38 | PlacesGeoResources, 39 | TrendsResources, 40 | SpamReportingResource, 41 | HelpResources, 42 | UndocumentedResources { 43 | } 44 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/TweetEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | /** 19 | * super interface of UserMentionEntity, URLEntity and HashtagEntity 20 | * 21 | * @author Yusuke Yamamoto - yusuke at mac.com 22 | * @since Twitter4J 3.0.4 23 | */ 24 | public interface TweetEntity { 25 | /** 26 | * Returns the text of the entity 27 | * 28 | * @return the text of the entity 29 | */ 30 | String getText(); 31 | 32 | /** 33 | * Returns the index of the start character of the entity in the tweet. 34 | * 35 | * @return the index of the start character of the entity in the tweet 36 | */ 37 | int getStart(); 38 | 39 | /** 40 | * Returns the index of the end character of the entity in the tweet. 41 | * 42 | * @return the index of the end character of the entity in the tweet 43 | */ 44 | int getEnd(); 45 | } 46 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/HashtagEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * A data interface representing one single Hashtag entity. 21 | * 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @since Twitter4J 2.1.9 24 | */ 25 | public interface HashtagEntity extends TweetEntity, java.io.Serializable { 26 | /** 27 | * Returns the text of the hashtag without #. 28 | * 29 | * @return the text of the hashtag 30 | */ 31 | String getText(); 32 | 33 | /** 34 | * Returns the index of the start character of the hashtag. 35 | * 36 | * @return the index of the start character of the hashtag 37 | */ 38 | int getStart(); 39 | 40 | /** 41 | * Returns the index of the end character of the hashtag. 42 | * 43 | * @return the index of the end character of the hashtag 44 | */ 45 | int getEnd(); 46 | } 47 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/RelatedResults.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Mocel - mocel at guma.jp 21 | * @since Twitter4J 2.1.8 22 | */ 23 | public interface RelatedResults extends TwitterResponse, java.io.Serializable { 24 | 25 | /** 26 | * Returns the 8 or less statuses with conversation 27 | * 28 | * @return list of statuses with conversation 29 | */ 30 | ResponseList getTweetsWithConversation(); 31 | 32 | /** 33 | * Returns the 8 or less statuses with reply. 34 | * 35 | * @return list of statuses with reply 36 | */ 37 | ResponseList getTweetsWithReply(); 38 | 39 | /** 40 | * Return the 3 or less latest statuses from the user who sent the origin tweet. 41 | * 42 | * @return list of latest statuses 43 | */ 44 | ResponseList getTweetsFromUser(); 45 | } 46 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/Trends.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | import java.util.Date; 20 | 21 | /** 22 | * A data class representing Trends. 23 | * 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | * @since Twitter4J 2.0.2 26 | */ 27 | 28 | public interface Trends extends TwitterResponse, Comparable, java.io.Serializable { 29 | Trend[] getTrends(); 30 | 31 | /** 32 | * Returns the location associated with the trends.
33 | * This method is effective only with getLocalTrends() method.
34 | * i.e. The return value of this method will be null with Search API Methods (getTrends(), getCurrentTrends(), getDailyTrends(), and getWeeklyTrends()).
35 | * 36 | * @return location 37 | * @since Twitter4J 2.1.1 38 | */ 39 | Location getLocation(); 40 | 41 | Date getAsOf(); 42 | 43 | Date getTrendAt(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/help/GetPrivacyPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.help; 18 | 19 | import twitter4j.Twitter; 20 | import twitter4j.TwitterException; 21 | import twitter4j.TwitterFactory; 22 | 23 | /** 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | * @since Twitter4J 2.1.7 26 | */ 27 | public class GetPrivacyPolicy { 28 | /** 29 | * Usage: java twitter4j.examples.help.GetPrivacyPolicy 30 | * 31 | * @param args String[] 32 | */ 33 | public static void main(String[] args) { 34 | try { 35 | Twitter twitter = new TwitterFactory().getInstance(); 36 | System.out.println(twitter.getPrivacyPolicy()); 37 | } catch (TwitterException te) { 38 | te.printStackTrace(); 39 | System.out.println("Failed to get privacy policy: " + te.getMessage()); 40 | System.exit(-1); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/AccountTotals.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.9 22 | */ 23 | public interface AccountTotals extends TwitterResponse, java.io.Serializable { 24 | /** 25 | * Returns the number of total updates. 26 | * 27 | * @return the number of total updates 28 | */ 29 | int getUpdates(); 30 | 31 | /** 32 | * Returns the number of total followers. 33 | * 34 | * @return the number of total followers 35 | */ 36 | int getFollowers(); 37 | 38 | /** 39 | * Returns the number of total favorites. 40 | * 41 | * @return the number of total favorites 42 | */ 43 | int getFavorites(); 44 | 45 | /** 46 | * Returns the number of total friends. 47 | * 48 | * @return the number of total friends 49 | */ 50 | int getFriends(); 51 | } 52 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/help/GetTermsOfService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.help; 18 | 19 | import twitter4j.Twitter; 20 | import twitter4j.TwitterException; 21 | import twitter4j.TwitterFactory; 22 | 23 | /** 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | * @since Twitter4J 2.1.7 26 | */ 27 | public class GetTermsOfService { 28 | /** 29 | * Usage: java twitter4j.examples.help.GetTermsOfService 30 | * 31 | * @param args String[] 32 | */ 33 | public static void main(String[] args) { 34 | try { 35 | Twitter twitter = new TwitterFactory().getInstance(); 36 | System.out.println(twitter.getTermsOfService()); 37 | } catch (TwitterException te) { 38 | te.printStackTrace(); 39 | System.out.println("Failed to get tems of service: " + te.getMessage()); 40 | System.exit(-1); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /twitter4j-appengine/src/main/java/twitter4j/internal/json/LazyPagableResponseList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j.internal.json; 17 | 18 | import twitter4j.PagableResponseList; 19 | import twitter4j.TwitterResponse; 20 | 21 | /** 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @since Twitter4J 2.2.4 24 | */ 25 | abstract class LazyPagableResponseList extends LazyResponseList implements PagableResponseList { 26 | public boolean hasPrevious() { 27 | return ((PagableResponseList) getTarget()).hasPrevious(); 28 | } 29 | 30 | public long getPreviousCursor() { 31 | return ((PagableResponseList) getTarget()).getPreviousCursor(); 32 | } 33 | 34 | public boolean hasNext() { 35 | return ((PagableResponseList) getTarget()).hasNext(); 36 | } 37 | 38 | public long getNextCursor() { 39 | return ((PagableResponseList) getTarget()).getNextCursor(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/api/SearchResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.api; 18 | 19 | import twitter4j.Query; 20 | import twitter4j.QueryResult; 21 | import twitter4j.TwitterException; 22 | 23 | /** 24 | * @author Joern Huxhorn - jhuxhorn at googlemail.com 25 | */ 26 | public interface SearchResource { 27 | /** 28 | * Returns tweets that match a specified query. 29 | *
This method calls http://search.twitter.com/search.json 30 | * 31 | * @param query - the search condition 32 | * @return the result 33 | * @throws TwitterException when Twitter service or network is unavailable 34 | * @see GET search | Twitter Developers 35 | * @see Twitter API / Search Operators 36 | * @since Twitter4J 1.1.7 37 | */ 38 | QueryResult search(Query query) throws TwitterException; 39 | } 40 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/util/CharacterUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.util; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | * @since Twitter4J 2.1.2 22 | */ 23 | public final class CharacterUtil { 24 | private CharacterUtil() { 25 | throw new AssertionError(); 26 | } 27 | 28 | /** 29 | * Counts the length of the tweet 30 | * 31 | * @param text tweet to be counted 32 | * @return the length of the tweet 33 | */ 34 | public static int count(String text) { 35 | return text.length(); 36 | } 37 | 38 | /** 39 | * Returns true if the length of the string is exceeding length limitation 40 | * 41 | * @param text String to be examined 42 | * @return if the length of the string is exceeding length limitation 43 | */ 44 | public static boolean isExceedingLengthLimitation(String text) { 45 | return count(text) > 140; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /twitter4j-core/src/test/java/twitter4j/MBeansIntegrationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | /** 19 | * Integration tests for APIStatistics ensuring that the integration logic 20 | * in Twitter (API client) works. 21 | * 22 | * @author Nick Dellamaggiore (nick.dellamaggiore gmail.com) 23 | */ 24 | public class MBeansIntegrationTest extends TwitterTestBase { 25 | 26 | public MBeansIntegrationTest(String name) { 27 | super(name); 28 | } 29 | 30 | @Override 31 | protected void setUp() throws Exception { 32 | super.setUp(); 33 | } 34 | 35 | public void testMonitoringIntegration() throws Exception { 36 | // monitoring is turned on with mbeanEnabled=true 37 | TwitterAPIMonitor monitor = TwitterAPIMonitor.getInstance(); 38 | long count = monitor.getStatistics().getCallCount(); 39 | twitter1.getHomeTimeline(); 40 | assertEquals(count + 1, monitor.getStatistics().getCallCount()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /twitter4j-async/src/main/java/twitter4j/api/UndocumentedResourcesAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j.api; 17 | 18 | /** 19 | * @author Yusuke Yamamoto - yusuke at mac.com 20 | * @author Mocel - mocel at guma.jp 21 | * @since 3.0.0 22 | */ 23 | public interface UndocumentedResourcesAsync { 24 | /** 25 | * If available, returns an array of replies and mentions related to the specified Tweet. There is no guarantee there will be any replies or mentions in the response. This method is only available to users who have access to #newtwitter. 26 | *
This method calls http://api.twitter.com/1.1/related_results/show/:id 27 | * 28 | * @param statusId the numerical ID of the status you're trying to retrieve 29 | * @see #newtwitter and the API - Twitter API Announcements | Google Group 30 | * @since Twitter4J 2.1.8 31 | */ 32 | void getRelatedResults(long statusId); 33 | } 34 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientBase.java: -------------------------------------------------------------------------------- 1 | package twitter4j.internal.http; 2 | 3 | import twitter4j.internal.logging.Logger; 4 | 5 | import java.io.DataOutputStream; 6 | import java.io.IOException; 7 | import java.io.Serializable; 8 | 9 | public abstract class HttpClientBase implements HttpClient, Serializable { 10 | private static final Logger logger = Logger.getLogger(HttpClientBase.class); 11 | private static final long serialVersionUID = 6944924907755685265L; 12 | protected final HttpClientConfiguration CONF; 13 | 14 | public HttpClientBase(HttpClientConfiguration conf) { 15 | this.CONF = conf; 16 | } 17 | 18 | @Override 19 | public void shutdown() { 20 | } 21 | 22 | protected boolean isProxyConfigured() { 23 | return CONF.getHttpProxyHost() != null && !CONF.getHttpProxyHost().equals(""); 24 | } 25 | 26 | public void write(DataOutputStream out, String outStr) throws IOException { 27 | out.writeBytes(outStr); 28 | logger.debug(outStr); 29 | } 30 | 31 | @Override 32 | public boolean equals(Object o) { 33 | if (this == o) return true; 34 | if (!(o instanceof HttpClientBase)) return false; 35 | 36 | HttpClientBase that = (HttpClientBase) o; 37 | 38 | if (!CONF.equals(that.CONF)) return false; 39 | 40 | return true; 41 | } 42 | 43 | @Override 44 | public int hashCode() { 45 | return CONF.hashCode(); 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return "HttpClientBase{" + 51 | "CONF=" + CONF + 52 | '}'; 53 | } 54 | } -------------------------------------------------------------------------------- /twitter4j-core/src/test/java/twitter4j/SpamReportingResourceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | /** 19 | * @author Yusuke Yamamoto - yusuke at mac.com 20 | * @since Twitter4J 2.2.4 21 | */ 22 | public class SpamReportingResourceTest extends TwitterTestBase { 23 | public SpamReportingResourceTest(String name) { 24 | super(name); 25 | } 26 | 27 | protected void setUp() throws Exception { 28 | super.setUp(); 29 | } 30 | 31 | protected void tearDown() throws Exception { 32 | super.tearDown(); 33 | } 34 | 35 | /* Spam Reporting Methods */ 36 | public void testReportSpammerSavedSearches() throws Exception { 37 | // Not sure they're accepting multiple spam reports for the same user. 38 | // Do we really need to test this method? How? 39 | //String reportUserId = "_xxxx_xxxxxx_"; 40 | //long reportUserLongId = 0x0; 41 | //assertNotNull(twitter2.reportSpam(reportUserId)); 42 | //assertNotNull(twitter2.reportSpam(reportUserLongId)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /twitter4j-core/src/test/java/twitter4j/http/BASE64EncoderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.http; 18 | 19 | import junit.framework.TestCase; 20 | import twitter4j.internal.http.BASE64Encoder; 21 | 22 | /** 23 | * @author Yusuke Yamamoto - yusuke at mac.com 24 | */ 25 | public class BASE64EncoderTest extends TestCase { 26 | public BASE64EncoderTest(String name) { 27 | super(name); 28 | } 29 | 30 | 31 | public void testEncode() { 32 | assertEquals("QUJDREVGRw==", BASE64Encoder.encode("ABCDEFG".getBytes())); 33 | assertEquals("VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2cu", BASE64Encoder.encode("The quick brown fox jumped over the lazy dog.".getBytes())); 34 | assertEquals("bGVhc3VyZS4=", BASE64Encoder.encode("leasure.".getBytes())); 35 | assertEquals("ZWFzdXJlLg==", BASE64Encoder.encode("easure.".getBytes())); 36 | assertEquals("YXN1cmUu", BASE64Encoder.encode("asure.".getBytes())); 37 | assertEquals("c3VyZS4=", BASE64Encoder.encode("sure.".getBytes())); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/json/EntityIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.json; 18 | 19 | /** 20 | * @author Yusuke Yamamoto - yusuke at mac.com 21 | */ 22 | abstract class EntityIndex implements Comparable, java.io.Serializable { 23 | private static final long serialVersionUID = 3864336402689899384L; 24 | private int start = -1; 25 | private int end = -1; 26 | 27 | @Override 28 | public int compareTo(EntityIndex that) { 29 | long delta = this.start - that.start; 30 | if (delta < Integer.MIN_VALUE) { 31 | return Integer.MIN_VALUE; 32 | } else if (delta > Integer.MAX_VALUE) { 33 | return Integer.MAX_VALUE; 34 | } 35 | return (int) delta; 36 | } 37 | 38 | void setStart(int start) { 39 | this.start = start; 40 | } 41 | 42 | void setEnd(int end) { 43 | this.end = end; 44 | } 45 | 46 | int getStart() { 47 | return start; 48 | } 49 | 50 | int getEnd() { 51 | return end; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /twitter4j-stream/src/test/resources/dao/24696018620.json: -------------------------------------------------------------------------------- 1 | {"profile_background_image_url":"http://s.twimg.com/a/1285193381/images/themes/theme11/bg.gif","description":"","profile_text_color":"362720","followers_count": 634,"status":{"retweet_count":0,"favorited":false,"coordinates":null,"place":null,"source":"web","contrib utors":null,"geo":null,"in_reply_to_status_id":null,"in_reply_to_screen_nam e":null,"in_reply_to_user_id":null,"retweeted_status": {"retweet_count":"100+","favorited":false,"coordinates":null,"place":null," source":"web","contributors":null,"geo":null,"in_reply_to_status_id":null," in_reply_to_screen_name":null,"in_reply_to_user_id":null,"retweeted":false, "truncated":false,"id": 24696018620,"text":"it's true...Im playing a bad man on CSI next Thursday!!!","created_at":"Thu Sep 16 20:46:48 +0000 2010"},"retweeted":false,"truncated":false,"id":24717207177,"text":"RT @justinbieber: it's true...Im playing a bad man on CSI next Thursday!!!","created_at":"Fri Sep 17 01:42:16 +0000 2010"},"following":false,"profile_background_tile":true,"show_all_inline_me dia":false,"friends_count": 1045,"profile_link_color":"B40B43","statuses_count":20,"listed_count": 43,"favourites_count": 1,"profile_sidebar_fill_color":"E5507E","contributors_enabled":false,"notif ications":false,"time_zone":null,"geo_enabled":false,"profile_sidebar_borde r_color":"CC3366","protected":false,"profile_image_url":"http://a1.twimg.com/profile_images/1110894385/2010051704345600000349480000100271_normal.jpg","url":null,"name" :"aleja....","verified":false,"profile_use_background_image":true,"screen_n ame":"alejita12345678","id": 177723113,"follow_request_sent":false,"lang":"es","utc_offset":null,"create d_at":"Thu Aug 12 22:27:30 +0000 2010","profile_background_color":"FF6699","location":""} -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/account/VerifyCredentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.account; 18 | 19 | import twitter4j.Twitter; 20 | import twitter4j.TwitterException; 21 | import twitter4j.TwitterFactory; 22 | import twitter4j.User; 23 | 24 | /** 25 | * Verifies credentials. 26 | * 27 | * @author Yusuke Yamamoto - yusuke at mac.com 28 | */ 29 | public final class VerifyCredentials { 30 | /** 31 | * Usage: java twitter4j.examples.account.VerifyCredentials 32 | * 33 | * @param args message 34 | */ 35 | public static void main(String[] args) { 36 | try { 37 | Twitter twitter = new TwitterFactory().getInstance(); 38 | User user = twitter.verifyCredentials(); 39 | System.out.println("Successfully verified credentials of " + user.getScreenName()); 40 | System.exit(0); 41 | } catch (TwitterException te) { 42 | te.printStackTrace(); 43 | System.out.println("Failed to verify credentials: " + te.getMessage()); 44 | System.exit(-1); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/QueryResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | import java.util.List; 20 | 21 | /** 22 | * A data interface representing search API response 23 | * 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | */ 26 | public interface QueryResult extends TwitterResponse, java.io.Serializable { 27 | long getSinceId(); 28 | 29 | long getMaxId(); 30 | 31 | /** 32 | * @deprecated use {@link #getRefreshURL()} instead 33 | */ 34 | String getRefreshUrl(); 35 | 36 | String getRefreshURL(); 37 | 38 | int getCount(); 39 | 40 | double getCompletedIn(); 41 | 42 | String getQuery(); 43 | 44 | List getTweets(); 45 | 46 | /** 47 | * Returns a Query instance to fetch next page or null if there is no next page. 48 | * 49 | * @return Query instance to fetch next page 50 | * @since Twitter4J 3.0.0 51 | */ 52 | Query nextQuery(); 53 | 54 | /** 55 | * test if there is next page 56 | * 57 | * @return if there is next page 58 | * @since Twitter4J 3.0.0 59 | */ 60 | boolean hasNext(); 61 | } 62 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsersIDs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.block; 18 | 19 | import twitter4j.IDs; 20 | import twitter4j.Twitter; 21 | import twitter4j.TwitterException; 22 | import twitter4j.TwitterFactory; 23 | 24 | /** 25 | * List blocking user ids. 26 | * 27 | * @author Yusuke Yamamoto - yusuke at mac.com 28 | */ 29 | public final class GetBlockingUsersIDs { 30 | /** 31 | * Usage: java twitter4j.examples.block.GetBlockingUsersIDs 32 | * 33 | * @param args message 34 | */ 35 | public static void main(String[] args) { 36 | try { 37 | Twitter twitter = new TwitterFactory().getInstance(); 38 | IDs ids = twitter.getBlocksIDs(); 39 | for (long id : ids.getIDs()) { 40 | System.out.println(id); 41 | } 42 | System.out.println("done."); 43 | System.exit(0); 44 | } catch (TwitterException te) { 45 | te.printStackTrace(); 46 | System.out.println("Failed to get blocking user ids: " + te.getMessage()); 47 | System.exit(-1); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /twitter4j-async/src/main/java/twitter4j/AsyncTwitter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package twitter4j; 17 | 18 | import twitter4j.api.*; 19 | import twitter4j.auth.AsyncOAuthSupport; 20 | import twitter4j.auth.OAuthSupport; 21 | 22 | /** 23 | * @author Yusuke Yamamoto - yusuke at mac.com 24 | * @since Twitter4J 2.2.0 25 | */ 26 | public interface AsyncTwitter extends java.io.Serializable, 27 | OAuthSupport, 28 | AsyncOAuthSupport, 29 | TwitterBase, 30 | TimelinesResourcesAsync, 31 | TweetsResourcesAsync, 32 | SearchResourceAsync, 33 | DirectMessagesResourcesAsync, 34 | FriendsFollowersResourcesAsync, 35 | UsersResourcesAsync, 36 | SuggestedUsersResourcesAsync, 37 | FavoritesResourcesAsync, 38 | ListsResourcesAsync, 39 | SavedSearchesResourcesAsync, 40 | PlacesGeoResourcesAsync, 41 | TrendsResourcesAsync, 42 | SpamReportingResourceAsync, 43 | HelpResourcesAsync, 44 | UndocumentedResourcesAsync { 45 | 46 | /** 47 | * Adds twitter listener 48 | * 49 | * @param listener TwitterListener 50 | */ 51 | void addListener(TwitterListener listener); 52 | } 53 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/TwitterResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * Super interface of Twitter Response data interfaces which indicates that rate limit status is avaialble. 21 | * 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @see twitter4j.DirectMessage 24 | * @see twitter4j.Status 25 | * @see twitter4j.User 26 | */ 27 | public interface TwitterResponse extends java.io.Serializable { 28 | /** 29 | * Returns the current rate limit status if available. 30 | * 31 | * @return current rate limit status 32 | * @since Twitter4J 2.1.0 33 | */ 34 | RateLimitStatus getRateLimitStatus(); 35 | 36 | /** 37 | * @return application permission model 38 | * @see Application Permission Model FAQ - How do we know what the access level of a user token is? 39 | * @since Twitter4J 2.2.3 40 | */ 41 | int getAccessLevel(); 42 | 43 | int NONE = 0; 44 | int READ = 1; 45 | int READ_WRITE = 2; 46 | int READ_WRITE_DIRECTMESSAGES = 3; 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/internal/http/StreamingGZIPInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * Copyright 2012 Twitter, Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package twitter4j.internal.http; 18 | 19 | import java.io.IOException; 20 | import java.io.InputStream; 21 | import java.util.zip.GZIPInputStream; 22 | 23 | final class StreamingGZIPInputStream extends GZIPInputStream { 24 | 25 | private final InputStream wrapped; 26 | 27 | public StreamingGZIPInputStream(InputStream is) throws IOException { 28 | super(is); 29 | wrapped = is; 30 | } 31 | 32 | /** 33 | * Overrides behavior of GZIPInputStream which assumes we have all the data available 34 | * which is not true for streaming. We instead rely on the underlying stream to tell us 35 | * how much data is available. 36 | *

37 | * Programs should not count on this method to return the actual number 38 | * of bytes that could be read without blocking. 39 | * 40 | * @return - whatever the wrapped InputStream returns 41 | * @throws IOException if an I/O error occurs. 42 | */ 43 | @Override 44 | public int available() throws IOException { 45 | return wrapped.available(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/spamreporting/ReportSpam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.spamreporting; 18 | 19 | import twitter4j.Twitter; 20 | import twitter4j.TwitterException; 21 | import twitter4j.TwitterFactory; 22 | 23 | /** 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | * @since Twitter4J 2.1.7 26 | */ 27 | public class ReportSpam { 28 | /** 29 | * Usage: java twitter4j.examples.spamreporting.ReportSpam [screen name] 30 | * 31 | * @param args String[] 32 | */ 33 | public static void main(String[] args) { 34 | if (args.length < 1) { 35 | System.out.println("java twitter4j.examples.spamreporting.ReportSpam [screen name]"); 36 | System.exit(-1); 37 | } 38 | try { 39 | Twitter twitter = new TwitterFactory().getInstance(); 40 | System.out.println("Successfully reported @" + twitter.reportSpam(args[0]).getScreenName() + " as a spammer."); 41 | } catch (TwitterException te) { 42 | te.printStackTrace(); 43 | System.out.println("Failed to report spam: " + te.getMessage()); 44 | System.exit(-1); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/RateLimitStatusEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j; 18 | 19 | /** 20 | * A data interface representing Twitter REST API's rate limit status 21 | * 22 | * @author Yusuke Yamamoto - yusuke at mac.com 23 | * @see Rate Limiting | Twitter Developers 24 | */ 25 | public final class RateLimitStatusEvent extends java.util.EventObject { 26 | 27 | private RateLimitStatus rateLimitStatus; 28 | 29 | private boolean isAccountRateLimitStatus; 30 | private static final long serialVersionUID = -2332507741769177298L; 31 | 32 | RateLimitStatusEvent(Object source, RateLimitStatus rateLimitStatus, boolean isAccountRateLimitStatus) { 33 | super(source); 34 | this.rateLimitStatus = rateLimitStatus; 35 | this.isAccountRateLimitStatus = isAccountRateLimitStatus; 36 | } 37 | 38 | public RateLimitStatus getRateLimitStatus() { 39 | return rateLimitStatus; 40 | } 41 | 42 | public boolean isAccountRateLimitStatus() { 43 | return isAccountRateLimitStatus; 44 | } 45 | 46 | public boolean isIPRateLimitStatus() { 47 | return !isAccountRateLimitStatus; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/block/CreateBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.block; 18 | 19 | import twitter4j.Twitter; 20 | import twitter4j.TwitterException; 21 | import twitter4j.TwitterFactory; 22 | 23 | /** 24 | * Blocks the specified user. 25 | * 26 | * @author Yusuke Yamamoto - yusuke at mac.com 27 | */ 28 | public final class CreateBlock { 29 | /** 30 | * Usage: java twitter4j.examples.block.CreateBlock [screen name] 31 | * 32 | * @param args message 33 | */ 34 | public static void main(String[] args) { 35 | if (args.length < 1) { 36 | System.out.println("Usage: java twitter4j.examples.block.CreateBlock [screen name]"); 37 | System.exit(-1); 38 | } 39 | try { 40 | Twitter twitter = new TwitterFactory().getInstance(); 41 | twitter.createBlock(args[0]); 42 | System.out.println("Successfully blocked user [" + args[0] + "]."); 43 | System.exit(0); 44 | } catch (TwitterException te) { 45 | te.printStackTrace(); 46 | System.out.println("Failed to block user: " + te.getMessage()); 47 | System.exit(-1); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/block/DestroyBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.block; 18 | 19 | import twitter4j.Twitter; 20 | import twitter4j.TwitterException; 21 | import twitter4j.TwitterFactory; 22 | 23 | /** 24 | * Unblocks the specified user. 25 | * 26 | * @author Yusuke Yamamoto - yusuke at mac.com 27 | */ 28 | public final class DestroyBlock { 29 | /** 30 | * Usage: java twitter4j.examples.block.DestroyBlock [screen name] 31 | * 32 | * @param args message 33 | */ 34 | public static void main(String[] args) { 35 | if (args.length < 1) { 36 | System.out.println("Usage: java twitter4j.examples.block.DestroyBlock [screen name]"); 37 | System.exit(-1); 38 | } 39 | try { 40 | Twitter twitter = new TwitterFactory().getInstance(); 41 | twitter.destroyBlock(args[0]); 42 | System.out.println("Successfully unblocked user [" + args[0] + "]."); 43 | System.exit(0); 44 | } catch (TwitterException te) { 45 | te.printStackTrace(); 46 | System.out.println("Failed to unblock user: " + te.getMessage()); 47 | System.exit(-1); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /twitter4j-core/src/test/java/twitter4j/internal/util/ParseUtilTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.internal.util; 18 | 19 | import junit.framework.TestCase; 20 | import twitter4j.internal.json.z_T4JInternalParseUtil; 21 | 22 | import java.text.SimpleDateFormat; 23 | 24 | /** 25 | * @author Yusuke Yamamoto - yusuke at mac.com 26 | * @since Twitter4J 2.1.5 27 | */ 28 | public class ParseUtilTest extends TestCase { 29 | public ParseUtilTest(String name) { 30 | super(name); 31 | } 32 | 33 | protected void setUp() throws Exception { 34 | super.setUp(); 35 | } 36 | 37 | protected void tearDown() throws Exception { 38 | super.tearDown(); 39 | } 40 | 41 | public void testParseLongReturns101() { 42 | assertEquals(101, z_T4JInternalParseUtil.getLong("100+")); 43 | } 44 | 45 | public void testParseIntOverflow() { 46 | assertEquals(-1, z_T4JInternalParseUtil.getInt("4294967295")); 47 | } 48 | 49 | public void testParseTrendDate() throws Exception { 50 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 51 | assertEquals("2011-07-11" 52 | , sdf.format(z_T4JInternalParseUtil.parseTrendsDate("2011-07-11T05:31:52Z"))); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/favorite/GetFavorites.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.favorite; 18 | 19 | import twitter4j.Status; 20 | import twitter4j.Twitter; 21 | import twitter4j.TwitterException; 22 | import twitter4j.TwitterFactory; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * Lists favorited statuses 28 | * 29 | * @author Yusuke Yamamoto - yusuke at mac.com 30 | */ 31 | public final class GetFavorites { 32 | /** 33 | * Usage: java twitter4j.examples.favorite.GetFavorites 34 | * 35 | * @param args message 36 | */ 37 | public static void main(String[] args) { 38 | try { 39 | Twitter twitter = new TwitterFactory().getInstance(); 40 | List statuses = twitter.getFavorites(); 41 | for (Status status : statuses) { 42 | System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText()); 43 | } 44 | System.out.println("done."); 45 | System.exit(0); 46 | } catch (TwitterException te) { 47 | te.printStackTrace(); 48 | System.out.println("Failed to get favorites: " + te.getMessage()); 49 | System.exit(-1); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/tweets/DestroyStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.tweets; 18 | 19 | import twitter4j.Twitter; 20 | import twitter4j.TwitterException; 21 | import twitter4j.TwitterFactory; 22 | 23 | /** 24 | * Destroys specified status. 25 | * 26 | * @author Yusuke Yamamoto - yusuke at mac.com 27 | */ 28 | public final class DestroyStatus { 29 | /** 30 | * Usage: java twitter4j.examples.tweets.DestroyStatus [status id] 31 | * 32 | * @param args message 33 | */ 34 | public static void main(String[] args) { 35 | if (args.length < 1) { 36 | System.out.println("Usage: java twitter4j.examples.tweets.DestroyStatus [status id]"); 37 | System.exit(-1); 38 | } 39 | try { 40 | Twitter twitter = new TwitterFactory().getInstance(); 41 | twitter.destroyStatus(Long.parseLong(args[0])); 42 | System.out.println("Successfully deleted status [" + args[0] + "]."); 43 | System.exit(0); 44 | } catch (TwitterException te) { 45 | te.printStackTrace(); 46 | System.out.println("Failed to delete status: " + te.getMessage()); 47 | System.exit(-1); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /twitter4j-examples/src/main/java/twitter4j/examples/timeline/GetMentions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.examples.timeline; 18 | 19 | import twitter4j.*; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * @author Yusuke Yamamoto - yusuke at mac.com 25 | * @since Twitter4J 2.1.7 26 | */ 27 | public class GetMentions { 28 | /** 29 | * Usage: java twitter4j.examples.timeline.GetMentions 30 | * 31 | * @param args String[] 32 | */ 33 | public static void main(String[] args) { 34 | // gets Twitter instance with default credentials 35 | Twitter twitter = new TwitterFactory().getInstance(); 36 | try { 37 | User user = twitter.verifyCredentials(); 38 | List statuses = twitter.getMentionsTimeline(); 39 | System.out.println("Showing @" + user.getScreenName() + "'s mentions."); 40 | for (Status status : statuses) { 41 | System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText()); 42 | } 43 | } catch (TwitterException te) { 44 | te.printStackTrace(); 45 | System.out.println("Failed to get timeline: " + te.getMessage()); 46 | System.exit(-1); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /twitter4j-core/src/main/java/twitter4j/auth/NullAuthorization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Yusuke Yamamoto 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package twitter4j.auth; 18 | 19 | import twitter4j.internal.http.HttpRequest; 20 | 21 | import java.io.ObjectStreamException; 22 | 23 | /** 24 | * An interface represents credentials. 25 | * 26 | * @author Yusuke Yamamoto - yusuke at mac.com 27 | */ 28 | public class NullAuthorization implements Authorization, java.io.Serializable { 29 | private static NullAuthorization SINGLETON = new NullAuthorization(); 30 | private static final long serialVersionUID = -8748173338942663960L; 31 | 32 | private NullAuthorization() { 33 | 34 | } 35 | 36 | public static NullAuthorization getInstance() { 37 | return SINGLETON; 38 | } 39 | 40 | public String getAuthorizationHeader(HttpRequest req) { 41 | return null; 42 | } 43 | 44 | public boolean isEnabled() { 45 | return false; 46 | } 47 | 48 | @Override 49 | public boolean equals(Object o) { 50 | return SINGLETON == o; 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return "NullAuthentication{SINGLETON}"; 56 | } 57 | 58 | private Object readResolve() throws ObjectStreamException { 59 | return SINGLETON; 60 | } 61 | 62 | } 63 | --------------------------------------------------------------------------------