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

New Module: Twit-ee - show data from the Twitter API in EE templates

Development and Programming

Christofer's avatar
Christofer
20 posts
15 years ago
Christofer's avatar Christofer
I’m attempting to retrieve the status from friends using the {exp:twitee:friends} tag-pair, however the {text} variable keeps returning blank? Am I using this correctly?

If everything works except the {text}, make sure that you don’t have nested your {exp:twitee:user_timeline} inside an {exp:weblog:entries} tag since that seems to overwrite the {text} variable…

       
eyevariety's avatar
eyevariety
158 posts
15 years ago
eyevariety's avatar eyevariety

This is working consistently for you guys?

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

Everything seems to be working fine except that when I use this code:

{exp:twitee:user_timeline limit="5" refresh="3"}
                    {if count == 1}<ul>{/if}
                        <li>{text}</li>
                    {if count == total_results}</ul>{/if}
                  {/exp:twitee:user_timeline}

For some reason the opening and closing ul tags are not appearing. Any ideas on why this could be.

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

solution to my post is to wrap the “count” in curly braces i.e. {count}

       
Mikee Bee's avatar
Mikee Bee
179 posts
15 years ago
Mikee Bee's avatar Mikee Bee

I’m having the same problem as Ian Ebden and Benjamin David. Used a variety of code but nothing is showing up at all. In fact its actually stopping the rest of the page from displaying at all!

I bet its something simple!

       
Derek Jones's avatar
Derek Jones
7,561 posts
15 years ago
Derek Jones's avatar Derek Jones

Hey George, Sean Smith found an error here, I’ll email you with some more details.

       
Matt Crest's avatar
Matt Crest
18 posts
15 years ago
Matt Crest's avatar Matt Crest

Everything is working as expected - almost.

Hash tags are being converted to links, but the generated link includes the hash tag, instead of % 23 (space added to prevent auto-conversion) as is required by Twitter search.

I believe what is happening is the module is converting # to % 23, but EE is then converting it back to #. I’ve tried messing around with line 851 of mod.twitee.php, but haven’t had any luck.

Any thoughts on a fix?

       
Chris Ruzin's avatar
Chris Ruzin
41 posts
15 years ago
Chris Ruzin's avatar Chris Ruzin
This tweet cut off right before the ampersand and gives this error message:
Warning: Twitee::_parse_status() [function.Twitee--parse-status]: unterminated entity reference Osugi Ren as "shockers": <a href="http://bit.ly/2gU1O">http://bit.ly/2gU1O</a> in /home/myacct/public_html/mydir/systemfolder/modules/twitee/mod.twitee.php on line 433

I ran into the same issue today. I fixed it by replacing this:

$status->text = $this->twitterStatusUrlConverter($status->text);
$status->text = $TYPE->parse_type($status->text, $prefs);
$status->text = $REGX->xss_clean($status->text);

with this:

$text = htmlspecialchars($status->text);
$text = $this->twitterStatusUrlConverter($text);
$text = $TYPE->parse_type($text, $prefs);
$status->text = $REGX->xss_clean($text);

in both the _parse_basic_user and _parse_status functions.

       
GuanoLad's avatar
GuanoLad
5 posts
15 years ago
GuanoLad's avatar GuanoLad

Something’s gone wacky. All the twitters in my “twitee” list are showing today’s date instead of the twitter “created_at” post date. Is it something to do with the Host server it’s on and Daylight Saving, which just clicked over where I am? Did Twitter itself maybe change something?

I’m using EE 1.6.8, if that matters.

EDIT MUCH LATER: Didn’t realise the standard time “format” EE tag doesn’t work for it. Strange thing to miss out.

       
mark59's avatar
mark59
88 posts
15 years ago
mark59's avatar mark59

How do you format the date in this module

I have the time for {created_at) appearing as Thu Apr 15 11:09:55 +0000 2010

and want to get rid of the year and the +0000 so it is just Thu Apr 15 11:09:55

Many Thanks

       
Henrik Eklund's avatar
Henrik Eklund
34 posts
15 years ago
Henrik Eklund's avatar Henrik Eklund

Dont know if this is a bug… But my client pointed out that they wanted url’s opened in a new window… if you look at the code for a link, it says:

<a href="http://lotidningen.lo.se/?id_item=27978" rel="extenal">

Shouldn’t it be:

<a href="http://lotidningen.lo.se/?id_item=27978" rel="external">

/Henrik

       
sm9's avatar
sm9
352 posts
15 years ago
sm9's avatar sm9

Hi there,

Even though I’ve entered the right username and password, I keep getting this error when I use some of the example code in a template:

Sorry, Twitter seems to be down.

Here’s the example code I’ve copied and pasted into a template:

{exp:twitee:public_timeline refresh="5" limit="10"}
{if count == 1}<ul>{/if}
    <li>{text}</li>
{if count == total_results}</ul>{/if}
{/exp:twitee:public_timeline}

Twitter seems to be working fine and I can’t see any issues reported on the Twitter API status page. I’ve also noticed that if I enter an incorrect password in the Module settings page, I get the same error message about Twitter being down.

I’m pretty sure I have cURL installed on this server as I also needed that for the Google Analytics extension to work.

Any ideas about this at all?

Thanks.

       
Matt Crest's avatar
Matt Crest
18 posts
15 years ago
Matt Crest's avatar Matt Crest
I ran into the same issue today. I fixed it by replacing this:
$status->text = $this->twitterStatusUrlConverter($status->text);
$status->text = $TYPE->parse_type($status->text, $prefs);
$status->text = $REGX->xss_clean($status->text);
with this:
$text = htmlspecialchars($status->text);
$text = $this->twitterStatusUrlConverter($text);
$text = $TYPE->parse_type($text, $prefs);
$status->text = $REGX->xss_clean($text);
in both the _parse_basic_user and _parse_status functions.

@Chris - Just wanted to say thanks for this. I was struggling through the module PHP and ready to try something different. Works like a gem now!

       
Cue's avatar
Cue
98 posts
15 years ago
Cue's avatar Cue
Sorry, Twitter seems to be down. Here’s the example code I’ve copied and pasted into a template:
{exp:twitee:public_timeline refresh="5" limit="10"}
{if count == 1}<ul>{/if}
    <li>{text}</li>
{if count == total_results}</ul>{/if}
{/exp:twitee:public_timeline}
Twitter seems to be working fine and I can’t see any issues reported on the Twitter API status page. I’ve also noticed that if I enter an incorrect password in the Module settings page, I get the same error message about Twitter being down. I’m pretty sure I have cURL installed on this server as I also needed that for the Google Analytics extension to work. Any ideas about this at all?

The default timeout for cURL execution within the module is set to 1 second if no timeout parameter is given.

For those suffering these symptoms and want a quick fix, just add the timeout parameter:

{exp:twitee:public_timeline refresh="5" limit="10" timeout="5"}
{if count == 1}<ul>{/if}
    <li>{text}</li>
{if count == total_results}</ul>{/if}
{/exp:twitee:public_timeline}

And, for a more permanent solution change the default timeout value; mod.twitee.php line 169 reads:

$this->timeout = ( ! $TMPL->fetch_param('timeout')) ? '1' : $TMPL->fetch_param('timeout');

Simply change the default value ‘1’ to the desired number of seconds (5-10 seconds seems reasonable).

Hope this helps.

       
sm9's avatar
sm9
352 posts
15 years ago
sm9's avatar sm9

Hi Cue,

Sorry for the delay in replying, and thanks for the pointer, much appreciated.

Thanks.

       
1 2 3 4

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.