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

George Ornbo's avatar
George Ornbo
272 posts
16 years ago
George Ornbo's avatar George Ornbo

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.

       
Kyle Short's avatar
Kyle Short
11 posts
16 years ago
Kyle Short's avatar Kyle Short

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 😊

       
ms's avatar
ms
274 posts
16 years ago
ms's avatar ms

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 😊

Markus

       
George Ornbo's avatar
George Ornbo
272 posts
16 years ago
George Ornbo's avatar George Ornbo

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.

       
Andru Edwards's avatar
Andru Edwards
330 posts
16 years ago
Andru Edwards's avatar Andru Edwards

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?

       
Deelicious's avatar
Deelicious
86 posts
16 years ago
Deelicious's avatar Deelicious

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?

       
George Ornbo's avatar
George Ornbo
272 posts
16 years ago
George Ornbo's avatar George Ornbo

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 .

       
Deelicious's avatar
Deelicious
86 posts
16 years ago
Deelicious's avatar Deelicious

Thanks, George! Worked like a charm. 😊

       
patdpoo's avatar
patdpoo
9 posts
16 years ago
patdpoo's avatar patdpoo

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

Parse error: syntax error, unexpected T_CONST, expecting 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 ;)

       
ms's avatar
ms
274 posts
16 years ago
ms's avatar ms

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.

       
patdpoo's avatar
patdpoo
9 posts
16 years ago
patdpoo's avatar patdpoo

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

Pat 😊

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

       
StraightSix's avatar
StraightSix
1 posts
16 years ago
StraightSix's avatar StraightSix

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.

       
rick.prince's avatar
rick.prince
111 posts
16 years ago
rick.prince's avatar rick.prince

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?

       
jonny.gotham's avatar
jonny.gotham
6 posts
16 years ago
jonny.gotham's avatar jonny.gotham

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.

       
George Ornbo's avatar
George Ornbo
272 posts
16 years ago
George Ornbo's avatar George Ornbo

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

       
1 2 3 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.