We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE Twitter Search

Development and Programming

pottercreative's avatar
pottercreative
17 posts
16 years ago
pottercreative's avatar pottercreative

What’s the default behavior when you use more than one term in the q=”kayak kayaking”?

Here’s my code:

{exp:twitter_search:find q="kayak kayaking" rpp="1" lang="en" convert_url="yes" cache="yes" refresh="5"}
<div class="tweets">
<span>{from_user}</span>
{profile_image_url}
{text}
</div>
{/exp:twitter_search:find}

I’d like to return let’s say 10 tweets containing the keywords ‘kayak’ and ‘kayaking’. If I use two keywords, does it return twice as many entries?

I also have rpp set to 1 but it’s returning 15 tweets. Am I missing something in the API?

Any help would be appreciated.

       
pottercreative's avatar
pottercreative
17 posts
16 years ago
pottercreative's avatar pottercreative

Also…

Is there a way to put this inside of a conditional, so that if there’s an error or the API calls have been maxed to display nothing?

for instance

{if twitter != ""}

{exp:twitter_search:find q="kayak kayaking" rpp="1" lang="en" convert_url="yes" cache="no" refresh="5"}
<div class="tweets">
<span>{from_user}</span>
{profile_image_url}
{text}
</div>
{/exp:twitter_search:find}

{/if}

Thanks!

       
lumis's avatar
lumis
119 posts
16 years ago
lumis's avatar lumis
{exp:twitter_search:find q="kayak OR kayaking" rpp="1" lang="en" convert_url="yes" cache="yes" refresh="5"}

<div class="tweets">
<span>{from_user}</span>
{profile_image_url}
{text}
</div>

{if no_results}
  show this
{/if}

{/exp:twitter_search:find}
       
pottercreative's avatar
pottercreative
17 posts
16 years ago
pottercreative's avatar pottercreative

Thx Lumis!

Exactly what I was looking for. Everything seems to be in working order now. I was having some trouble with the rpp returning 15 when I asked for 5. I’m presuming this was a cache issue or the way I was declaring the ‘q=’ variable ….. anyhow, seems to have resolved itself now.

Thank you again.

       
lumis's avatar
lumis
119 posts
16 years ago
lumis's avatar lumis

pottercreative strange because i am seeing the same issue now, I am looking into it

       
pottercreative's avatar
pottercreative
17 posts
16 years ago
pottercreative's avatar pottercreative

Here’s my original code:

{exp:twitter_search:find q="kayaking seakayak" rpp="5" lang="en" convert_url="yes" cache="no" refresh="5"}
<div class="tweets">
{profile_image_url}
<span>{text}</span>
</div>
{/exp:twitter_search:find}

I thought maybe the twitter API was interpreting my ‘q’ variable as 3 queries — 1 for kayaking, 1 for the whitespace and 1 for seakayak. Wondering if this was happening since I wasn’t using

q="kayaking OR seakayak"
       
lumis's avatar
lumis
119 posts
16 years ago
lumis's avatar lumis

ok i found the problem its fixed now if you want to download new version

here are some examples

All of these words

{exp:twitter_search:find q="cow moon" rpp="5" lang="en" convert_url="yes" cache="yes" refresh="5"}
{profile_image_url}{text}

{/exp:twitter_search:find}

Any of these words

{exp:twitter_search:find q="cow OR moon" rpp="5" lang="en" convert_url="yes" cache="yes" refresh="5"}
{profile_image_url}{text}

{/exp:twitter_search:find}

exclude words

{exp:twitter_search:find q="kayaking -kayak" rpp="5" lang="en" convert_url="yes" cache="yes" refresh="5"}
{profile_image_url}{text}

{/exp:twitter_search:find}

This exact phrase

{exp:twitter_search:find phrase="cow moon" rpp="5" lang="en" convert_url="yes" cache="yes" refresh="5"}
{profile_image_url}{text}

{/exp:twitter_search:find}

pretty much anything you can pass into this form http://search.twitter.com/advanced you can pass into this ee tag you can just take the URL vars returned after the search on that form and add them to the EE tag

the only exception would be the location would have to be passed in through the geocode= as “lat,lon,distance”

       
Wes Baker's avatar
Wes Baker
343 posts
16 years ago
Wes Baker's avatar Wes Baker

Is there anyway to convert the absolute dates (Apr 23, 2009 - 10:42 AM) to relative times (About two minutes ago)?

       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
16 years ago
Sean C. Smith's avatar Sean C. Smith

Wes,

I think this might help

       
lumis's avatar
lumis
119 posts
16 years ago
lumis's avatar lumis

Wes Just updated the plugin with a {relative_date} var give it a try

       
Wes Baker's avatar
Wes Baker
343 posts
16 years ago
Wes Baker's avatar Wes Baker

David, Thanks a lot for the quick turnaround.

Sean, Thanks for the alternate solution, I didn’t even have time to try it out…

       
Richard Frank's avatar
Richard Frank
200 posts
16 years ago
Richard Frank's avatar Richard Frank

Hi Lumis.

Thanks again for a great plugin - between this and eeFlickr you’ve saved me countless nights.

Questions:

  • Can I run more than one feed on one page? I’m getting varying results; sometimes it works, sometimes it doesn’t. Does your caching support this?

  • What are the API guidelines from twitter. If I hit their server 10 times (for 10 different feeds) are they going to have a problem with it; is it going to prevent me from doing it?

Thanks, Richard

       
lumis's avatar
lumis
119 posts
16 years ago
lumis's avatar lumis

@Richard

yes more than one feed per page works fine. The caching is EE’s native tag caching. alternatively you can also use template caching.

you can find the guidelines on Twitters API here http://apiwiki.twitter.com/Terms-of-Service

and rate limiting here http://apiwiki.twitter.com/Rate-limiting

The default rate limit for calls to the API is 100 requests per hour. The API does account- and IP-based rate limiting. Authenticated API calls are charged to the authenticating user’s limit while unauthenticated API calls are deducted from the calling IP address’ allotment.

This plug-in is unauthenticated calls

       
Wes Baker's avatar
Wes Baker
343 posts
16 years ago
Wes Baker's avatar Wes Baker

Could you change your php short tags to standard PHP tags? On servers that don’t support short tags, it renders the plugin page as blank. It’s a small issue and easily changed, but it might be affecting other people.

It was doing this in your Relative Date plugin as well.

Thanks, Wes

       
Manuela Hoffmann's avatar
Manuela Hoffmann
14 posts
16 years ago
Manuela Hoffmann's avatar Manuela Hoffmann

I have installed the plugin today but it does not seem to update. I use

{exp:twitter_search:find q="from:pixelgraphix" rpp="1" lang="de" convert_url="yes" cache="yes" refresh="5" word_censoring="on"}
       
1 2 3 4 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.