What's new? | Help | Directory | Sign in
Google
tagyu4j
Java API for Tagyu REST web services interface
  
  
  
  
    
Search
for
Updated Sep 22, 2007 by cliffano
Labels: Featured
Usage  

getTagSuggestions

Getting tags for the text "imagine all the people".

Tagyu4J tagyu4J = new Tagyu4J();
TagSuggestionsResponse response = tagyu4J.getTagSuggestions("imagine all the people");
String category = response.getCategory();
List suggestedTags = response.getSuggestedTags();
Iterator it = suggestedTags.iterator();
while (it.hasNext()) {
    Tag tag = (Tag)it.next();
    String value = tag.getValue();
    String relation = tag.getRelation();
    String href = tag.getHref();
}

Getting tags for the URL www.nba.com.

Tagyu4J tagyu4J = new Tagyu4J();
TagSuggestionsResponse response = tagyu4J.getTagSuggestions("www.nba.com");
String category = response.getCategory();
List suggestedTags = response.getSuggestedTags();
Iterator it = suggestedTags.iterator();
while (it.hasNext()) {
    Tag tag = (Tag)it.next();
    String value = tag.getValue();
    String relation = tag.getRelation();
    String href = tag.getHref();
}

getRelatedTags

Getting tags related to "music".

Tagyu4J tagyu4J = new Tagyu4J();
RelatedTagsResponse response = tagyu4J.getRelatedTags("music");
List relatedTags = response.getSuggestedTags();
Iterator it = relatedTags.iterator();
while (it.hasNext()) {
    Tag tag = (Tag)it.next();
    String value = tag.getValue();
    String relation = tag.getRelation();
    String href = tag.getHref();
}

authentication

There's a limit of 1 request / minute for anonymous users. You can register for a soft cap limit of 1000 requests / day. To authenticate with your registered account, set Tagyu4J instance with Tagyu username and password.

Tagyu4J tagyu4J = new Tagyu4J();
tagyu4J.setAuthentication("username", "password");


Sign in to add a comment