• Resolved migueltic

    (@migueltic)


    Hi, I would like to know more about the Custom API Query, I haven’t found any documentation regarding this.
    Does it use Search API, Streaming API or both?
    What is the URL of the Twitter documentation where I can see the available parameters, response keys…?

    Another little question (not directly related, if you want I can open a different topic for this): Is there someway of using the Rule by Search without the limit of 100 results? (I think it’s not an API limit, right?)

    Thanks!

    https://www.ads-software.com/plugins/fetch-tweets/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    Hi, I would like to know more about the Custom API Query, I haven’t found any documentation regarding this.

    In order to display tweets from Twitter, the plugin needs to do the followings:

    1. Perform Twitter API requests and retrieves data.
    2. Display those data.

    The plugin constructs API request URI from the field values set in the rule definition page to perform the former part of the steps. The rule types such as Timeline, Search, List are for the types of the Twitter API requests such as statuses/user_timeline, search/tweets, lists/statuses. As you can see in the linked pages, there are different types of requests that Twitter API provides. The plugin’s Custom Query rule type is for those who can construct custom API queries by themselves.

    What is the URL of the Twitter documentation where I can see the available parameters, response keys…?

    Try this: https://api.twitter.com/1.1/lists/members.json?slug=wordpress-community&owner_screen_name=miunosoft&cursor=-1

    And activate the Debug template via Dashboard -> Fetch Tweets -> Templates and select the Debug template in the rule definition page. You’ll see the response data. Then display them in your way with a custom template.

    Thread Starter migueltic

    (@migueltic)

    Thanks miunosoft!

    I don’t know how to create custom API queries, but willing to learn. Could you please give me links to relevant documentation or manuals? (I’ve googled “custom API queries twitter” and I don’t see anything about it).

    You haven’t answered my question: “Does it use Search API, Streaming API or both?”, but I guess that it uses only REST API and that Streaming API is not available through your plugin, right?

    You haven’t answered either my last question: Is there some way of using a Rule by Search without the limit of 100 results? (please tell me if I should open a separate topic for this question)

    Thanks again for your time and for this great plugin! ??

    Plugin Author miunosoft

    (@miunosoft)

    I don’t know how to create custom API queries, but willing to learn. Could you please give me links to relevant documentation or manuals? (I’ve googled “custom API queries twitter” and I don’t see anything about it).

    The Twitter REST API documentation pages are the ones you need to look up.

    You haven’t answered my question: “Does it use Search API, Streaming API or both?”, but I guess that it uses only REST API and that Streaming API is not available through your plugin, right?

    That’s right. The Custom Query rule type is not for the Streaming API but REST API and for the GET method. So you need to explorer the Twitter API documentation pages whose title starts with GET.

    For example, in this page, (https://dev.twitter.com/rest/reference/get/trends/place), scroll down to the bottom and you’ll see the example request URI.

    https://api.twitter.com/1.1/trends/place.json?id=1

    Try setting it in the plugin’s Custom Query rule setting page and see the result with the Debug template.

    You haven’t answered either my last question: Is there some way of using a Rule by Search without the limit of 100 results? (please tell me if I should open a separate topic for this question)

    See this page. https://dev.twitter.com/rest/reference/get/search/tweets And check out the count parameter section. See what it says about the maximum number of tweets that can be retrieved.

    Thread Starter migueltic

    (@migueltic)

    OK, now I have the Custom Query thing much more clear. Thanks!

    Regarding the question of the 100 results, in the count section it says “per page”. So if I’m understanding it right, we could fetch much more than 100 if we split it in different pages (each with 100 tweets). Any chance we could get several pages of results with a pager, a “see more tweets” link or something like that, in order to see more than the initial 100 results/tweets?

    Plugin Author miunosoft

    (@miunosoft)

    Yes and no.

    So if I’m understanding it right, we could fetch much more than 100 if we split it in different pages (each with 100 tweets).

    Yes but you have to know the exact Tweet ID that starts the page for the since_id or the max_id parameter. See this page (https://dev.twitter.com/rest/public/timelines).

    Any chance we could get several pages of results with a pager, a “see more tweets” link or something like that, in order to see more than the initial 100 results/tweets?

    You need to code that in a custom template. You cannot do that with the Custom Query rule type because you need to know the since_id or max_id value when you create a rule and those values always change dynamically as tweets are updated regularly.

    Thread Starter migueltic

    (@migueltic)

    OK, now it’s 100% clear. Thanks for all your help, miunosoft! ??
    Marking this as solved.

    Plugin Author miunosoft

    (@miunosoft)

    Glad it helped!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom API Query usage’ is closed to new replies.