Hello, I think there may be some kind of error in the string returned as ‘next_results’ when executing a search with the ‘result_type’ set as ‘mixed’.
The ‘max_id’ on the ‘next_results’ returned is set to the Id of the oldest tweet received, but it consider the tweets with ‘result_type’ as ‘popular’, and it should only consider the ones with ‘result_type’ as ‘recent’ because otherwise the oldest tweet would be probably one of the popular ones and when we use the ‘next_results’ string for our next query, the tweets returned will be much older than expected.
For example for the query:
https://api.twitter.com/1.1/search/tweets.json?q=twitter&result_type=mixed&count=1
The result obtained would be:
{
statuses: [4]
0: {
metadata: {
result_type: "popular"
iso_language_code: "en"
}-
created_at: "Wed May 08 13:24:12 +0000 2013"
id: 332123772679249900
id_str: "332123772679249920"
...
}
1: {
metadata: {
result_type: "popular"
iso_language_code: "nl"
}-
created_at: "Wed May 08 19:00:04 +0000 2013"
id: 332208295903391740
id_str: "332208295903391744"
...
}-
2: {
metadata: {
result_type: "popular"
iso_language_code: "en"
}-
created_at: "Wed May 08 07:38:46 +0000 2013"
id: 332036840750207000
id_str: "332036840750206976"
...
}-
3: {
metadata: {
result_type: "recent"
iso_language_code: "en"
}-
created_at: "Thu May 09 11:04:40 +0000 2013"
id: 332451045080965100
id_str: "332451045080965121"
...
}-
-
search_metadata: {
max_id: 332451045080965100
max_id_str: "332451045080965121"
next_results: "?max_id=332036840750206975&q=twitter&count=1&include_entities=1&result_type=mixed"
query: "twitter"
refresh_url: "?since_id=332451045080965121&q=twitter&result_type=mixed&include_entities=1"
count: 1
since_id: 0
since_id_str: "0"
}-
}
As you can see [Line 47] the ‘next_results’ have as ‘max_id’ the id corresponding with the third popular tweet [Line 30] not with the last one of the ‘recent’ ones [Line 40]. So when we execute the next query the tweets that we get will be tweets older than the third popular and we will be probably missing many tweets.
I don’t know if this is the desired behavior but it seems very odd to me.
Best regards.