jublo / codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.
https://www.jublo.net/projects/codebird/php
GNU General Public License v3.0
776 stars 234 forks source link

search_tweets with more than one search term #215

Closed gerkelly closed 5 years ago

gerkelly commented 7 years ago

I'm using the search_tweets method to find tweets with a particular search term.

$params = array( 'q' => 'apache', 'src' => 'typd' );
$replies = $cb->search_tweets( $params );

This works perfectly. However, I cannot figure out how to use this method to search for more than one search term. eg. I want to find tweets containing 'apache' and 'php'.

Thanks for any help!

mynetx commented 7 years ago

https://twitter.com/search?q=apache%20php&src=typd

Does this work?

$terms = ['apache', 'php'];
$params = ['q' => implode(' ', $terms), 'src' => 'typd'];
$replies = $cb->search_tweets($params);
mynetx commented 6 years ago

@gerkelly Please look into the code above?

mynetx commented 5 years ago

Closing since there were no further replies.