Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show last tweets plugin
#1
Hi there!

Just using Get Simple for a short while, but I really like it. Simple and clean!
One thing I missed a bit for my own site, just a simple and private site, was showing one or two last tweets from my twitter account.
I was able to create some script for it, but later I thought: what the f*, lets make it a plugin!

So there it is, "my first plugin", you can find it in the Extend:
http://get-simple.info/extend/plugin/last-tweets/357/

Let me know if you can use it, when you use it, and of course: whenever you find a bug, let me kkow!
Oh, please be gentle, I am not really familiar in PHP...

Version History:
  • 1.2: added application based oAuth Twitter authentication
  • 1.1 non working version (as of June 11th 2013)



Frank Prins
Reply
#2
Hi Frank,

Thx for the plugin, looks great.
I was busy to create a plugin for this to. But ended tweaking the default Twitter widget and this looks great in the sidebar. See my http://getsimple.dare-is.nl/twitter

Here is the code, replace 'xxx' with your Twitter username
Code:
<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<h2>Twitter Feeds</h2>
<style>
.twtr-widget {
    margin-left: -15px;
}
.twtr-widget .twtr-tweet {
    border-bottom: 1px inset #666;
}
.twtr-hd,
.twtr-ft {
    display: none!important;
}
</style>
<script>
    new TWTR.Widget({
      version: 2,
      type: 'profile',
      rpp: 4,
      interval: 3000,
      width: 250,
      height: 300,
      theme: {
        shell: {
          background: '#EFEFEF',
          color: '#575657'
        },
        tweets: {
          background: '#EFEFEF',
          color: '#333333',
          links: '#315ee6'
        }
      },
      features: {
        scrollbar: true,
        loop: true,
        live: true,
        behavior: 'default'
      }
    }).render().setUser('xxx').start();
</script>

EDIT: Hmm, the widget is having a HUGE caching problem. So don't use it (yet). Sad
Reply
#3
Hey Rene,

Thanks for that, also looks nice, some I did (using some php) before turning it into a plugin...
And yes, caching might always be a problem with this, I noticed someone using a kind of local cache, checking timestamps before getting tweets. I was already thinking of doing that too.

keep you posted,
regards,
Frank

Rene Wrote:Hi Frank,

Thx for the plugin, looks great.
I was busy to create a plugin for this to. But ended tweaking the default Twitter widget and this looks great in the sidebar. See my http://getsimple.dare-is.nl/twitter

Here is the code, replace 'xxx' with your Twitter username
Code:
<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<h2>Twitter Feeds</h2>
<style>
.twtr-widget {
    margin-left: -15px;
}
.twtr-widget .twtr-tweet {
    border-bottom: 1px inset #666;
}
.twtr-hd,
.twtr-ft {
    display: none!important;
}
</style>
<script>
    new TWTR.Widget({
      version: 2,
      type: 'profile',
      rpp: 4,
      interval: 3000,
      width: 250,
      height: 300,
      theme: {
        shell: {
          background: '#EFEFEF',
          color: '#575657'
        },
        tweets: {
          background: '#EFEFEF',
          color: '#333333',
          links: '#315ee6'
        }
      },
      features: {
        scrollbar: true,
        loop: true,
        live: true,
        behavior: 'default'
      }
    }).render().setUser('xxx').start();
</script>

EDIT: Hmm, the widget is having a HUGE caching problem. So don't use it (yet). Sad
Reply
#4
In the config page suddenly I get the following ...

Code:
{.../LASTTWEET_TITLE}

{.../LASTTWEET_DESC_LONG}

{.../TWITTER_ACCOUNT}

At the location of the dots there is the name of one of my plugins. It works only when I deactivate all my plugins?
I'm doing something wrong?
Reply
#5
Hi guys,

Soon I need to use a twitter widget on a project for a client.

Couple of questions though:
Firstly, is Frank's plugin having a HUGE caching problem or rather the default Twitter widget?

Secondly, is the plugin able to show more tweets or just the last 2? More would definitely be preferable.

Thirdly, I assume a link to the twitter account can also be switched on? Or does one have to add a seperate link in the template?

And lastly, seeing Rene's last post, I do take it the plugin works when other plugins are installed?
Reply
#6
Hi Rene,

Yep, others also noticed this behaviour, unfortunately.
I am working on it, in fact it already has been solved, in the next release.
As I did quite some changes now, added caching possibility for example, I need to do some extensive testing, after that it will be in the extend. Give me a couple of days.

cheers,
Frank


Rene Wrote:In the config page suddenly I get the following ...

Code:
{.../LASTTWEET_TITLE}

{.../LASTTWEET_DESC_LONG}

{.../TWITTER_ACCOUNT}

At the location of the dots there is the name of one of my plugins. It works only when I deactivate all my plugins?
I'm doing something wrong?
Reply
#7
Draxeiro Wrote:Hi guys,
Draxeiro,

What do you exactly mean by a caching problem? In the plugin as it is right now, there is no caching at all, with every load of the page it will get the last updates from twitter.
So if you meant: a problem because there is no caching, you are absolutely right.
Simple caching is in the next release, almost there. It will store the last update in a local file, and with every load it will look if the file is older than x time (configurable).
You can choose the amount of tweets to show, 1 to 9 for now, in the admin.
The link to the account is not there, nice idea though, maybe in the future ok? For adding a link in the template yourself is indeed an option too...

regards,
Frank


Soon I need to use a twitter widget on a project for a client.

Couple of questions though:
Firstly, is Frank's plugin having a HUGE caching problem or rather the default Twitter widget?

Secondly, is the plugin able to show more tweets or just the last 2? More would definitely be preferable.

Thirdly, I assume a link to the twitter account can also be switched on? Or does one have to add a seperate link in the template?

And lastly, seeing Rene's last post, I do take it the plugin works when other plugins are installed?
Reply
#8
@Frank - Ok, I'll wait for the next release of your plugin

@Draxeiro
Both! The default Twitter widget is having problems, the twitter api allows 'only' 150 calls to the feed per hour.
Frank's current plugin is having some problems but he is working on a new plugin release in which he added caching possibility.
The plugin can show more than 2 tweets and tweets should be linking to the twitter account.
Reply
#9
Hey Guys,

I just updated this plugin to V0.7.

Added the caching thing, configurable time for caching.
Dutch language.
Total rewrite of the code, cleaned up! (had a look at how other do it, way cleaner)
Language support is probably better now

Let me know if you find bugs! (still below V1.0 :-))

Frank
Reply
#10
Frank,

You did a good job. Great update!

Didn't find any bug, one minor thing > link in Tweet; plugin shows link iso description (see on http://getsimple.dare-is.nl/twitter)

Possibility in config to show in front button/link 'More Tweets' to Twitter account?

Furthermore possibility in config to set language? I like my Getsimple core/admin in 'en_US' and (all) my plugins in 'nl_NL'. But most plugins read locale settings.
Reply
#11
Hey Rene,

Glad you like it, thx. But what do you mean by "link iso descr"?
Both other suggestions: good functionality, like the ideas.
Will work on it in the next release...

Frank

Rene Wrote:Frank,

You did a good job. Great update!

Didn't find any bug, one minor thing > link in Tweet; plugin shows link iso description (see on http://getsimple.dare-is.nl/twitter)

Possibility in config to show in front button/link 'More Tweets' to Twitter account?

Furthermore possibility in config to set language? I like my Getsimple core/admin in 'en_US' and (all) my plugins in 'nl_NL'. But most plugins read locale settings.
Reply
#12
Hi Frank,

Sorry, 'iso' is short & lazy for 'instead of', so ...
The plugin shows a link instead of the description. Here's an example of one of my Tweets ...

Your plugin:
Rotterdam ziet af van 'afvaltaks' http://t.co/HONiKfg via http://@telegraaf

Twitter widget:
Rotterdam ziet af van 'afvaltaks' http://telegraaf.nl/s/11319816 via http://@telegraaf

http://t.co/HONiKfg is the url from http://telegraaf.nl/s/11319816
Reply
#13
Not being a twitter-user myself but isn't the way Frank's plugin shows it, the way that twitter itself shows links too when you're on their site?

Thanks for releasing the new version by the way, I will be using it soon on a project and for the time being will make sure to add the link to the twitter account in the template.

Goed werk!
Reply
#14
Hi Draxeiro,

Well no, I guess Rene is right here: twitter themself parse the shortened link, and short the final link as the title. Will think on a (fast/responsive) way to copy that behaviour.
Rene, iso, haha, could have guessed that one!

to be continued!

Draxeiro Wrote:Not being a twitter-user myself but isn't the way Frank's plugin shows it, the way that twitter itself shows links too when you're on their site?

Thanks for releasing the new version by the way, I will be using it soon on a project and for the time being will make sure to add the link to the twitter account in the template.

Goed werk!
Reply
#15
Just uploaded a new version in extend, v0.8:
0.8: implemented "get long url" to expand shortened url's, rewrote caching for that too

I used www.longurlplease.com to get the long url. In the earlier version I cached the whole set of json data from twitter, but that had been changed now, otherwise I had to parse the json again and again, including the url expanding. So now there is caching of an serialized array, just before parsing it to the template.

Have a look, and let me know!

and have fun, above all...
Frank
Reply
#16
Thanks for this -- very handy! I found that the function_exists('show_tweets') check always fails so I've simply been using <?php show_tweets(); ?> on its own, just in case anyone else is finding that nothing is showing.

EDIT: Whoops, spoke too soon -- seemed to work on the live site at first, then stopped displaying tweets (ditto in the settings preview), then the page stopped rendering past the widget! Bizarrely perfect from localhost, though. Web dev!
Reply
#17
Hi Sledge,

Thx for having a look into last tweets! So, two problems:

-> function_exists() is not working for?
Mmm, I hope someone else can shine a light on this? I got this way of calling the function from the wiki, in "How to Install GetSimple Plugins", it says exactly that... can't re-create the issue as it is working for me.

-> On your live site it is not working, on dev it is?
First thing I am thinking of is permissions, although there is a check for that. Can you check if the dir data\other\lasttweets and both files in it are writeable?
And maybe turn on debugging for a moment and see if that gives an idea?

Let me know! succes,
Frank


Sledge Wrote:Thanks for this -- very handy! I found that the function_exists('show_tweets') check always fails so I've simply been using <?php show_tweets(); ?> on its own, just in case anyone else is finding that nothing is showing.

EDIT: Whoops, spoke too soon -- seemed to work on the live site at first, then stopped displaying tweets (ditto in the settings preview), then the page stopped rendering past the widget! Bizarrely perfect from localhost, though. Web dev!
Reply
#18
Great plugin, although if possible could you add a "...more" at the end of the tweet that'll link to the actual tweet on twitter.com?
Reply
#19
not working for me.

Tried the api twitter url directly, and that is still getting data. Somehow it is just not processed by the plugin.

Can anyone confirm this is still working?

// Nevermind, hardcoded one of the options mentioned above into the site
http:// f6design.com/journal/2010/10/07/display-recent-twitter-tweets-using-php/
EDIT: http://www.queness.com/post/10778/create...he-support
<º)))><
Reply
#20
uitdecom Wrote:not working for me.

Tried the api twitter url directly, and that is still getting data. Somehow it is just not processed by the plugin.

Can anyone confirm this is still working?

// Nevermind, hardcoded one of the options mentioned above into the site
( http://f6design.com/journal/2010/10/07/d...using-php/ )

Still works for me, although it already is some time ago i wrote this. Maybe there are some options i didn't know at that time?
what is the user id you want to use? I can debug when I have some time (quite limited at the moment).
Reply
#21
Thank you,
but it's not really nescesary anymore.

And as long nobody else is complaining it must have been something with my setup. I'll give it another try next time and let you know.
<º)))><
Reply
#22
Hi,
I installed this plugin on my site (hosted on a IIS) and it is working fine.
Using it, I just found out some bugs:

1) First, the language file "it.php" should be renamed in "it_IT.php", I made this change and it works perfectly now.
2) When I create a link on Twitter (e.g. mysite.com) the function crashes and it shows this messages:
Fatal error: Call to undefined function curl_init() in lasttweet_functions.php on line 184 (it is connected with the site http://www.longurlplease.com/)

I hope these can be helpful tips. Cheers.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#23
Hi D.O. ,
Sorry for the late, very late reply! I didn't get an update on replies...
I will try to have a look at the error in the next couple of days, shouldn't be too much trouble I guess.
Are you able to post the exact string you had on twitter? If I can recreate the error, I can find out what to do.

thx,
Frank

(2013-04-05, 21:17:03)D.O. Wrote: Hi,
I installed this plugin on my site (hosted on a IIS) and it is working fine.
Using it, I just found out some bugs:

1) First, the language file "it.php" should be renamed in "it_IT.php", I made this change and it works perfectly now.
2) When I create a link on Twitter (e.g. mysite.com) the function crashes and it shows this messages:
Fatal error: Call to undefined function curl_init() in lasttweet_functions.php on line 184 (it is connected with the site http://www.longurlplease.com/)

I hope these can be helpful tips. Cheers.
Reply
#24
No rush Frank!
Take your time, Read You Later!
D.O.

(2013-04-26, 04:47:09)twodogwalker Wrote: Hi D.O. ,
Sorry for the late, very late reply! I didn't get an update on replies...
I will try to have a look at the error in the next couple of days, shouldn't be too much trouble I guess.
Are you able to post the exact string you had on twitter? If I can recreate the error, I can find out what to do.

thx,
Frank

(2013-04-05, 21:17:03)D.O. Wrote: Hi,
I installed this plugin on my site (hosted on a IIS) and it is working fine.
Using it, I just found out some bugs:

1) First, the language file "it.php" should be renamed in "it_IT.php", I made this change and it works perfectly now.
2) When I create a link on Twitter (e.g. mysite.com) the function crashes and it shows this messages:
Fatal error: Call to undefined function curl_init() in lasttweet_functions.php on line 184 (it is connected with the site http://www.longurlplease.com/)

I hope these can be helpful tips. Cheers.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#25
Hey D.O.

Mmm, cannot reproduce this issue. Can you state me the string, of give me an example of a twitter user which has a tweet with this issue?

thx,
Frank

(2013-04-26, 05:09:10)D.O. Wrote: No rush Frank!
Take your time, Read You Later!
D.O.

(2013-04-26, 04:47:09)twodogwalker Wrote: Hi D.O. ,
Sorry for the late, very late reply! I didn't get an update on replies...
I will try to have a look at the error in the next couple of days, shouldn't be too much trouble I guess.
Are you able to post the exact string you had on twitter? If I can recreate the error, I can find out what to do.

thx,
Frank
Reply




Users browsing this thread: 3 Guest(s)