|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.deepamehta.core.osgi.PluginActivator org.deepamehta.plugins.twitter.TwitterPlugin
public class TwitterPlugin
A very basic client for researching with the public Twitter Search API v1.1 and DeepaMehta 4.1.2
Fields inherited from class de.deepamehta.core.osgi.PluginActivator |
---|
bundle, dms |
Constructor Summary | |
---|---|
TwitterPlugin()
|
Method Summary | |
---|---|
private void |
authorizeSearchRequests()
|
private void |
checkACLsOfMigration()
Code running once, after plugin initialization. |
private void |
configureIfReady()
|
private TopicModel |
createGeoCoordinateTopicModel(double lng,
double lat)
|
private Topic |
createTweet(org.codehaus.jettison.json.JSONObject item,
long userTopicId,
ClientState clientState)
|
private Topic |
createTwitterUser(String userId,
String userName,
String userImageUrl,
ClientState clientState)
|
private Topic |
getTweet(org.codehaus.jettison.json.JSONObject item,
long userTopicId,
ClientState clientState)
|
private Topic |
getTwitterUser(String userId,
String userName,
String userImageUrl,
ClientState clientState)
|
void |
init()
Initialize the migrated soundsets ACL-Entries. |
private void |
processTwitterSearchResponse(Topic twitterSearch,
StringBuffer resultBody,
ClientState clientState)
Private Helper Methods |
Topic |
searchMoreTweets(long searchId,
boolean nextPage,
ClientState clientState)
This method executes an existing search-query to either: (a) fetch more (older) tweets for the same query or (b) fetch new tweets and assign them to the current search result |
Topic |
searchPublicTweets(long searchId,
String query,
String resultType,
String lang,
String location,
ClientState clientState)
Fetches public tweets matching the given query , maintains a search-query topic and
references existing tweets and users, as it should be. |
void |
serviceArrived(PluginService service)
--- Implementing PluginService Interfaces to consume AccessControlService --- |
void |
serviceGone(PluginService service)
|
Methods inherited from class de.deepamehta.core.osgi.PluginActivator |
---|
getBundleContext, postInstall, publishDirectory, setCoreService, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Logger log
private final String DEEPAMEHTA_VERSION
private final String TWITTER_RESEARCH_VERSION
private final String CHARSET
private static final String CHILD_URI
private static final String PARENT_URI
private static final String AGGREGATION
private static final String COMPOSITION
private static final String TWEET_URI
private static final String TWEET_ID_URI
private static final String TWEET_TIME_URI
private static final String TWEET_CONTENT_URI
private static final String TWEET_ENTITIES_URI
private static final String TWEET_METADATA_URI
private static final String TWEET_SOURCE_BUTTON_URI
private static final String TWEET_LOCATION_URI
private static final String TWEET_FAVOURITE_COUNT_URI
private static final String TWEET_WITHHELD_DMCA_URI
private static final String TWEET_WITHHELD_IN_URI
private static final String TWEET_WITHHELD_SCOPE_URI
private static final String TWEETED_TO_STATUS_ID
private static final String TWITTER_USER_URI
private static final String TWITTER_USER_ID_URI
private static final String TWITTER_USER_NAME_URI
private static final String TWITTER_USER_IMAGE_URI
private static final String TWITTER_SEARCH_URI
private static final String TWITTER_SEARCH_LANG_URI
private static final String TWITTER_SEARCH_LOCATION_URI
private static final String TWITTER_SEARCH_TYPE_URI
private static final String TWITTER_SEARCH_NEXT_PAGE_URI
private static final String TWITTER_SEARCH_REFRESH_URL_URI
private static final String TWITTER_SEARCH_MAX_TWEET_URI
private static final String TWITTER_SEARCH_RESULT_SIZE_URI
private static final String TWITTER_SEARCH_TIME_URI
private static final String TWITTER_AUTHENTICATION_URL
private static final String TWITTER_SEARCH_BASE_URL
private final String GEO_COORDINATE_TOPIC_URI
private final String GEO_LONGITUDE_TYPE_URI
private final String GEO_LATITUDE_TYPE_URI
private boolean isInitialized
private boolean isAuthorized
private String bearerToken
private AccessControlService acService
Constructor Detail |
---|
public TwitterPlugin()
Method Detail |
---|
public void init()
init
in interface PluginContext
init
in class PluginActivator
private void configureIfReady()
private void authorizeSearchRequests() throws TwitterAPIException
TwitterAPIException
public Topic searchMoreTweets(long searchId, boolean nextPage, @HeaderParam(value="Cookie") ClientState clientState)
searchMoreTweets
in interface TwitterService
{searchId}
- id of the "Twitter-Search"-Topic to operate on{nextPage}
- true
for paging query to next page;
false
for fetching most recent tweetspublic Topic searchPublicTweets(long searchId, String query, String resultType, String lang, String location, @HeaderParam(value="Cookie") ClientState clientState)
query
, maintains a search-query topic and
references existing tweets and users, as it should be.
searchPublicTweets
in interface TwitterService
{id}
- Twitter Search Topic Id{resultType}
- "mixed", "recent", "popular"{lang}
- ISO-639-1 Code (2 chars) (optional){location}
- "lat,lng,radiuskm" (optional)private void processTwitterSearchResponse(Topic twitterSearch, StringBuffer resultBody, ClientState clientState)
private Topic getTweet(org.codehaus.jettison.json.JSONObject item, long userTopicId, ClientState clientState)
private Topic createTweet(org.codehaus.jettison.json.JSONObject item, long userTopicId, ClientState clientState)
private Topic getTwitterUser(String userId, String userName, String userImageUrl, ClientState clientState)
private Topic createTwitterUser(String userId, String userName, String userImageUrl, ClientState clientState)
private TopicModel createGeoCoordinateTopicModel(double lng, double lat)
private void checkACLsOfMigration()
public void serviceArrived(PluginService service)
serviceArrived
in interface PluginContext
serviceArrived
in class PluginActivator
public void serviceGone(PluginService service)
serviceGone
in interface PluginContext
serviceGone
in class PluginActivator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |