1 of 3
1
New Module: Twit-ee - show data from the Twitter API in EE templates
Posted: 10 February 2009 11:17 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  342
Joined  09-09-2006

Twit-ee fetches data from the Twitter API and allows you to display it in your ExpressionEngine templates. A variety of tags are available allowing you to show your own tweets, your friends tweets and more.

System Requirements:

* ExpressionEngine Version 1.6.x
* PHP 5.x.x
* cURL support

Example:
The following will show the authenticating user’s 10 most recent favorite tweets with a cache time of 30 minutes

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


Download, licensing and documentation can be found here.

Please report bugs and add feature requests below.

Feel free to fork the project from GitHub and send a patch / pull request to help with bug fixing and feature requests.

 Signature 

Shape Shed

Profile
 
 
Posted: 10 February 2009 06:46 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  14
Joined  12-11-2008

Hi George,

Trying to test this out, but I get an error on attempting to install

“Unable to locate the files needed to install this module”

Just thought I’d ping you smile

 Signature 

Biz: http://www.endstate.com
Blog: http://www.kylewrites.com

Profile
 
 
Posted: 10 February 2009 10:32 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  329
Joined  03-16-2002

Hi George,

nice addition. I was able to install the module, so no problem regarding that point (PHP 5.1.x, EE 1.6.7).

However, I have a small issue I already had with the the twitter_search plugin: The output is broken if the option “Enable GZIP Output?” is set to yes in the output and debugging preferences of EE.

In addition, it would be great if the module would be MSM friendly - e.g. store different twitter account details per MSM site (or allow to overwrite the default setting inside the EE tag).

BTW: I tried to use the project wiki but it seems so need some account edit a page there. Using the forums is less troublesome in that case grin

Markus

Profile
 
 
Posted: 11 February 2009 03:34 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  342
Joined  09-09-2006

ms - thanks for the report. I’ve amended the post to use this thread for bugs and feature requests.

I’m going to wait for it to be in the wild for a little longer and will then look at bugs and features like making it MSM compatible.

 Signature 

Shape Shed

Profile
 
 
Posted: 11 February 2009 12:31 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  476
Joined  12-14-2004

For me, I would need two things from this module - if it had them, I’d pay for it:

1) MSM compatibility. At this point, anything released for EE should be MSM compatible. I can’t consider using anything that isn’t.

2) The ability to display replies to a Tweet, preferable within a certain timeframe. So for example say I post an entry, which appears on Twitter. I’d like to be able to tell this module to pull in any @ replies that have come in from within the first, say, 20 minutes. Then I should be able to manually delete any that aren’t truly a direct reply to the entry. Kind of like what you see here: http://chris.pirillo.com/is-amazons-kindle-on-fire/ - that is done by way of Wordpress plugin though. Can Twit-ee already do this?

 Signature 

Love gadgets, technology, and pop culture? Visit us at Gear Live: http://www.gearlive.com

Profile
 
 
Posted: 12 February 2009 03:28 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  131
Joined  05-09-2007

Seems like a really great module, George! Is there a way to format the {created_at} into a prettier form, possibly just Tue Feb 10 17:11?

Profile
 
 
Posted: 12 February 2009 04:33 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  342
Joined  09-09-2006

ms wrote

The output is broken if the option “Enable GZIP Output?” is set to yes in the output and debugging preferences of EE.

This is fixed in version 1.0.1.

Deelicious wrote:

Is there a way to format the {created_at} into a prettier form, possibly just Tue Feb 10 17:11?

I’m not planning support lots of different time formats but thankfully PHP can take care of it for you.

Enable PHP in templates and then use this:

<?php
$created_at 
strtotime("{created_at}");
echo 
date("D M j G:i "$created_at);
?> 

See the PHP date function if you want to change the formatting to pretty much anything else.

Using this method you could also compare the timestamp to now and format a “3 hours ago” or similar .

 Signature 

Shape Shed

Profile
 
 
Posted: 12 February 2009 04:55 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  131
Joined  05-09-2007

Thanks, George! Worked like a charm. smile

Profile
 
 
Posted: 16 February 2009 02:21 PM   [ Ignore ]   [ # 8 ]  
Summer Student
Avatar
Total Posts:  14
Joined  01-03-2004

I’ve installed the module and am getting this error when adding to my template.

Parse errorsyntax errorunexpected T_CONSTexpecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/mysite/public_html/sys/modules/twitee/mod.twitee.php on line 28 

I was using this piece of code in my template:

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

Thanks for the help.

Pat ;)

Profile
 
 
Posted: 17 February 2009 06:11 AM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  329
Joined  03-16-2002

Pat,

are you sure your webspace is meeting the requirements - especially PHP 5.x? Code looks fine, but the error might imply you’re still using PHP 4.x.

Profile
 
 
Posted: 17 February 2009 10:11 AM   [ Ignore ]   [ # 10 ]  
Summer Student
Avatar
Total Posts:  14
Joined  01-03-2004

Hi, thanks for your response.  I thought I was on PHP 5, but I’m double checking now. 

Pat smile

Update:  Am I php5 - but couldn’t get it to work so used the regular Twitter code off their website.

Profile
 
 
Posted: 25 March 2009 09:06 AM   [ Ignore ]   [ # 11 ]  
Summer Student
Total Posts:  1
Joined  09-29-2008

I was seeing the same error and I’m running PHP 5.1.6 (hosted at EngineHosting). It was sporadic though and while troubleshooting, I found that occasionally refreshing the PHP Info Utility page, it would instead show that I was running PHP Version 4.3.9

I have a note in with Nevin and crew to determine what’s going on.

When PHP 5.x is running, the module is a wonderful addition. Thanks for your work on this!

Update: It turns out that my site is on a cluster at EH that’s in the middle of an upgrade from PHP 4.x to PHP 5.1.6. It should be completed tonight and resolve the module errors I’m seeing.

Profile
 
 
Posted: 08 April 2009 12:33 AM   [ Ignore ]   [ # 12 ]  
Lab Assistant
RankRank
Total Posts:  152
Joined  07-18-2007

How can I get links to link? I’m just getting plain text outputs, but I’d like to ensure when I post a link users can actually click it. This:

My tweet text a link http://tinyurl.com/1234 

Should be:

My tweet text a link - <a href="http://tinyurl.com/1234">http://tinyurl.com/1234</a> 

Am I missing something really basic here?

Profile
 
 
Posted: 12 April 2009 11:41 PM   [ Ignore ]   [ # 13 ]  
Summer Student
Total Posts:  6
Joined  04-03-2007

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?  In the end, I basically want to get a list of the authenticated user’s status and the status of the friends, so I’m using the following:

{exp:twitee:user_timeline refresh="15" limit="1"}
<li>{name}{text}</li>
{/exp:twitee:user_timeline}
{exp
:twitee:friends refresh="15"}
<li>{name}{text}</li>
{/exp:twitee:friends} 

Any help would be great.  All variables seem to work except the {text} variable, and I’m at a bit of a loss.  Thanks again.

Profile
 
 
Posted: 01 May 2009 04:05 AM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  342
Joined  09-09-2006

There’s a minor update available to this module allowing a separate account for MSM sites. To enable MSM compatibility please upload the new files then uninstall and reinstall the module. The download is available from Github

rick.prince wrote

How can I get links to link? I’m just getting plain text outputs, but I’d like to ensure when I post a link users can actually click it.

This is a feature enhancement - I’ve filed this on the github site.

jonny.gotham wrote

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?

Yes it does look correct and I can replicate this as a bug. I have filed this as an issue and will address it in an upcoming build.

You can track the status of bugs and feature requests on the Github issues page

 Signature 

Shape Shed

Profile
 
 
Posted: 01 May 2009 05:23 AM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  342
Joined  09-09-2006

I’ve just pushed a further update (version 1.15) up to Github.

This now automatically converts links to html links, and also supports hash tag links and links to @username.

@jonny.gotham

You need the friends_timeline method to get the statuses of friends. Try this code:

{exp:twitee:user_timeline refresh="15" limit="1"}
<li>{name}{text}</li>
{/exp:twitee:user_timeline}
{exp
:twitee:friends_timeline refresh="15"}
<li>{name}{text}</li>
{/exp:twitee:friends_timeline} 
 Signature 

Shape Shed

Profile
 
 
Posted: 03 May 2009 03:51 PM   [ Ignore ]   [ # 16 ]  
Summer Student
Total Posts:  6
Joined  04-03-2007

But what if I’m attempting to only get the latest status from each friend, as in 1 status per friend being followed, rather than the stream of the latest 20.  That was why I went with using :

{exp:twitee:friends}
{
/exp:twitee:friends} 

As the description says that it “Returns the authenticating user’s friends, each with current status inline. They are ordered by the order in which they were added as friends.”  So what I’m attempting to display is the friend and current status, 1 status per.  Is that possible?

Thank you for the help!

Profile
 
 
Posted: 19 May 2009 03:44 AM   [ Ignore ]   [ # 17 ]  
Grad Student
Rank
Total Posts:  64
Joined  11-19-2004

This tweet cut off right before the ampersand and gives this error message:

WarningTwitee::_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 
Profile
 
 
Posted: 27 May 2009 02:42 PM   [ Ignore ]   [ # 18 ]  
Summer Student
Total Posts:  6
Joined  04-03-2007

George:

Thanks again for all the work with this module.

I have a question though.  Does the Twit-ee module have a fail-safe in place or a user adjustable timeout if Twitter goes down?  With the boom in Twitter popularity and maintenance issues it’s been having recently, I just wanted to know what will happen if Twitter itself fails.  At this point I know that invalid login information in the module will stop the entire site in its tracks, but will the same happen if the module cannot connect to Twitter?  If so, is there a way for me to prevent that?

I have noticed definite slow-downs and stalls after introducing the module, and while some is expected with the API call, I wonder if the stalls are related to the module not being able to connect to twitter and a long timeout delay?

Any information would be great!  Thanks again for the great module!

Profile
 
 
   
1 of 3
1