Twitter Search API does not work when server cookies are present

The problem seems to be related to the Twitter Search API and cookies. The following results were not found:

GET http://search.twitter.com/search.json?q=%23tweetz HTTP / 1.1
Accept: * / *
Accept-Language: en-us
Content-Type: application / x-www-form-urlencoded
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
User-Agent: Mozilla / 4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64;
x64; Trident / 4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET
CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0; .NET4.0C; .NET4.0E)
Host: search.twitter.com
Connection: Keep-Alive
Cookie: k = 68.40.12.103.1280961938551221; guest_id = 128035711958013764;
lang = en;
_twitter_sess = BAh7CDoPY3JlYXRlZF9hdGwrCJWulT8qASIKZmxhc2hJQzonQWN0aW9uQ29u
% 250AdHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoHaWQiJWQ3% 250AMWIxNzJlZmUzNThmM2Y1NGRkYz6wbf65bcfbbf8b8f8b8f8fcbbf8

The response is:

HTTP / 1.0 200 OK
Date: Thu, 05 Aug 2010 00:32:14 GMT
Server: hi
Status: 200 OK
X-Served-From: sjc1r085
X-Runtime: 0.02556
Content-Type: application / json; charset = utf-8
X-Timeline-Cache-Hit: Hit
X-Served-By: sjc1v012.prod.twitter.com
Cache-Control: max-age = 15, must-revalidate, max-age = 300
Expires: Thu, 05 Aug 2010 00:37:14 GMT
Content-Length: 251
Vary: Accept-Encoding
X-Varnish: 2325786061
Age: 0
Via: 1.1 varnish
X-Cache-Svr: sjc1v012.prod.twitter.com
X-Cache: MISS
Connection: close

{"results": [], "max_id": 20340216330, "since_id":
20294384707, "refresh_url": "? Since_id = 20340216330 & q =
% 23tweetz "," results_per_page ": 15," page ": 1," completed_in ":
0.017987, "warning": "adjusted since_id to 20294384707 due to temporary
error "," query ":"% 23tweetz "}

If I issue the same request without cookies (using Fiddler), the response contains the corresponding tweets.

I cannot delete cookies because they are issued by the server (I launch the browser). Any thoughts?

+3
source share
1 answer

This is because you logged in to Twitter in the same browser session. Because of this, you received a cookie with the default language filter "lang = en"

( , , ) - lang = all like: http://search.twitter.com/search.json?lang=all&q=%23tweetz

+1

Source: https://habr.com/ru/post/1758119/


All Articles