Twitter - Search mentions source fails to return expected tweets

This topic was automatically generated from Slack. You can find the original thread here.

Adam Gordon Bell : Hi, I am attempting to use the twitter search source and I think I’m hitting this issue: Slack . I want to search for something with quotes in it, but I’m struggling to figure out how to overcome this url encoding problem.

Adam Gordon Bell : Specially if I search for “exact phrase” it is always zero results.

Adam Gordon Bell : where the quotes are part of the search term

Adam Gordon Bell : I’m using https://rss.app/ to get around this, but seems less than ideal

Dylan Sather (Pipedream) : can you tell me the specific phrase you were searching for? Is it possible there are no tweets that were sent with that phrase within the last week? The Twitter Search API has a notable limitation:

> Keep in mind that the search index has a 7-day limit. In other words, no tweets will be found for a date older than one week.
If you enter a high-volume query like "star wars" in the Search Mentions source, it does find tweets and emit events, so I’m curious if that explains it.

Adam Gordon Bell : Sure, it has tweets. Here is a link https://twitter.com/search?q=%22best%20tech%20podcast%22%20OR%20%22any%20tech%20po[…]t%22%20OR%20%22which%20tech%20podcast%22&src=typed_query&f=live

Adam Gordon Bell : And I believe I was getting errors if using brackets as well, which we discussed via email

Dylan Sather (Pipedream) : Thanks, but the latest tweet I see from that set is from July 2nd, which is more than 7 days ago. The search API unfortunately won’t return those tweets

Adam Gordon Bell : Oh, interesting. I should have read what you said more carefully :slightly_smiling_face:

Dylan Sather (Pipedream) : If you create the source now, we should monitor for new tweets, and you should see those moving forward

Dylan Sather (Pipedream) : try creating the source and posting a test tweet that contains your exact phrase, and it should work

Adam Gordon Bell : Is there an easy way to log the request that is being made to twitter so that I can debug things like this in the future?

Adam Gordon Bell : > try creating the source and posting a test tweet that contains your exact phrase, and it should work
That is a good idea

Dylan Sather (Pipedream) : Because of the way we deploy sources into your account, we only let you edit the main, “entrypoint” file in the Configuration tab of the source’s code in the Pipedream UI. The code that makes this specific API request is included in a shared library file, [here](http://return%20(await%20this._makeRequest({), so can’t be edited through the UI.

But you can use the Pipedream CLI to deploy a source, and edit any of the files that compose the source locally. So in this case, I edited that file, and then moved into this directory of the repo:

components/twitter/sources/search-mentions/

and ran:

pd dev source-mentions.js

You can read more about the way we develop Pipedream sources, and more about pd dev, here

Adam Gordon Bell : I saw that I could build sources, but hadn’t dug in that far. Thanks for your help Thanks