Spring Social Twitter REST API and "until" date - java

I am trying to retrieve tweets for a hashtag using Spring Social Twitter APIs.
When I pass the date in required format in "until" field, I am not able to retrieve the tweets.
I even tried directly invoking the REST API using https://dev.twitter.com/rest/tools/console (example https://api.twitter.com/1.1/search/tweets.json?
q=<>&lang=en&count=10&until=2016-12-10).
However without the "until" date API works fine both through Spring and REST Tool.
Appreciate if anyone could help me understand this behavior.

The Twitter Search API only searches against tweets in the last 7 days (as mentioned in the documentation). Thus, if your until field is before 7 days from the query submission, no results will return.
The only way to retrieve tweets posted longer than 7 days is to order a paid subscription to a Twitter service that has the ability to search against Twitter's historic data (i.e. Gnip, Nuvi, etc.). There are currently no free options that achieve this objective.

Related

Linkedin Social Action API Related

#LinkedIn
Greeting to all,
I have a question regarding Social Actions API, Basically I wanted to know that there is an particular API for getting all number of Posts along with data like (comments or like) on are linkedin Page? (Please Share an Proper Example [this is demo API which we are using https://api.linkedin.com/v2/socialActions/urn:li:ugcPost:xxxxxxxx/])
Basically, our target is that to getting all numbers of posts which are present on my linked page plus we wanted to check also that if we received a comment on my any post so how we can reply on against him using an linkedin API's
It sounds like you're looking for some of the Marketing APIs. There is a Posts API that would allow you to search for posts by author. There is also a Social Actions API to get numbers of comments and likes. Note that you need to be approved to use these APIs.

Twitter4j vs Twitter hbc

I have used Twitter4j in past to read twitter public stream but have not used twitter hbc (which is twitter's official java library for streaming apis).
My use-case is to :
Listen to a twitter stream based on certain filter query.
My question is ?
what is your experience with these two above library and which is more suitable for usecase like mine
Short Answer
If you want to see the tweets tweeted about your search criteria right now in real time: go for hbc-twitter4j.
If you have questions like: get me up to date what happened in the recent past about your search criteria: go for Twitter4J.
Some details why
hbc is good at network reconnecting and network error handling in the background. This gives you a stable real time stream, especially with a bad network.
This is good if you watch what happens right now for hours.
I did not find a way to select the recent days like with Twitter4J.
Twitter4J: unlike hbc, it is easy to ask Twitter4J what happened in the recent past.
Twitter4J has some maintenance, hbc does not.
Both can store the result in Twitter4J classes like Status to give you easy access to the relevant Twitter fields.

How to search specific HashTags in twitter API 1.1 using java

I am using twitter API 1.1 and want to search specific hashTags in twitter. can any one help me out how to do this in java
First, see what Twitter API says about it.
The URL you should use is https://api.twitter.com/1.1/search/tweets.json?q=AHashtag. Be sure you're authenticated before trying to execute the query!
EDIT
A java code example can be found here.

How to google programmatically?

I want to query google programmatically in Java, to get texts for relation extraction purposes.
For example, I want to write in Java:
result_list=googleAgent.search("Berlin Germany");
In result_list, I can get a list of sentences which contain "Berlin" and "Germany". Then I can do NLP analysis and extract the relation.
Can I do it at all? And how if so?
Google prohibits programmatic searches directly through their website (that's why they have a search API). If you insist on trying to do this, Google will eventually pop up a captcha that your client will have to solve. So now you'll be trying to do NLP while you're doing OCR ;)
However, their search API isn't that great. You're limited to a certain number of queries per day (100) and information per result.
You can use Google's Custom Search API

Google page index - java

does any one has idea how to get google page index in Java?
I was googleing since last 2-3 days but helpless, can any one refer me API for that or give some suggestion for how to do that
Lots of thanks in advance
For example if we search for facebook in google, we get around 22,980,000,000 results. So I want to fetch this number using JAVA
make a corresponding HTTP request from Java to Google, then parse the replied HTML code. There is a div with the ID resultStats. This div contains the number of results.
Not sure what your real requirement is, what kind of index do you want? Google export fairly a bit amount of APIs via RESTful service, some of them are packaged with JavaScript lib like Google MAP API. There are also Java client library for OAUTH authentication
The custom search API information could be found at http://code.google.com/apis/customsearch/v1/overview.html. A comprehensive list of google APIs could be accessed at https://code.google.com/apis/console

Categories

Resources