Forums / Addon Sideboxes / Twitter sidebox Cached

Twitter sidebox Cached

Results 1 to 20 of 71
09 Jun 2011, 15:19
#1
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Twitter sidebox Cached

This Zen Cart add on allows you to display your latest tweets in a side box.

An important feature is that the script only connects to the Twitter server once in a while and caches the result. This prevents you from exceeding the maximum amount of requests per hour that Twitter allows you (currently 150). And it also prevents that your site slows down when the Twitter server is slow or not responding.

For now the zip file will be attached to this post. It will be uploaded to the "Plugins" later.
09 Jun 2011, 15:55
#2
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

Oops, forgot about some translations. These will follow soon.
10 Jun 2011, 16:20
#3
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

Ok, here's the multilingual version.
(For now attached to this post, will be transferred to the "Free Software Add Ons")
11 Jun 2011, 16:21
#4
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

@TODO:

- Add Twitter and/or Follow Us icons

And maybe:
- Tweet filter. So that you can hide some specific tweets from your shop visitors.
- Load some extra tweets, but display the desired number only.

The last one is because tweets are still counted after deletion (for some time?). So if you set to display 5 tweets and you delete 3 of your recent tweets only 2 will display. I am not sure if this is a Twitter bug or that it is by design. If the latter is the case it's probably a good idea to load some extra tweets and limit the number that is displayed.
20 Jun 2011, 12:58
#5
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

New in v1.03

- Fixed minor bug (links to tweets did not work)
- Added Twitter logo and Follow us button
- Added basic tweet filter

(uploaded to the Free Software Add Ons, expected to be available for download soon)
23 Jun 2011, 13:57
#6
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

paulm:

uploaded to the Free Software Add Ons, expected to be available for download soon
Meanwhile v1.03 attached to this post.
25 Jun 2011, 12:08
#7
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

Download moved to:
Free Software Add Ons
25 Jun 2011, 12:42
#8
misty avatar

misty

Inactive

Join Date:
Apr 2004
Posts:
5,752
Plugin Contributions:
1

Re: Twitter sidebox Cached

Thanks for creating/sharing Paul
:clap:
12 Sep 2011, 03:32
#9
rammerson avatar

rammerson

New Zenner

Join Date:
Oct 2010
Posts:
9
Plugin Contributions:
0

Re: Twitter sidebox Cached

Hi Image using the latest version of zen.
I installed this module and it worked fine. When I went to edit the username in the file specified in the help file and upload to my server it doesnt change the user?? Still your account.

Ill try and leave it up for a day or so. Good Module wish it worked.

http://goo.gl/nVLBD
12 Sep 2011, 03:47
#10
rammerson avatar

rammerson

New Zenner

Join Date:
Oct 2010
Posts:
9
Plugin Contributions:
0

Re: Twitter sidebox Cached

Its working! Wonderful sidebox module.
12 Sep 2011, 09:52
#11
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

rammerson:

I installed this module and it worked fine. When I went to edit the username in the file specified in the help file and upload to my server it doesnt change the user?? Still your account.
That shows the cache works! :cool: And glad to hear it works after all :smile:

But to prevent this issue on new installs you can:

- Edit the user setting before installation (the instruction to install and test first, and edit the settings afterwards, is to prevent bogus parse error reports cause by editing errors...)

- Or use the hidden manual cache refresh feature (easier than editing the cache refresh period). It's possible to force a cache refresh by opening this url in your browser: www.yourdomain.tld/?refresh_twitter_cache (or www.yourdomain.tld/yourzenshop/?refresh_twitter_cache if that's the location of your shop of course)
(cache age needs to be > 60 seconds).
19 Sep 2011, 13:23
#12
wakeleymb avatar

wakeleymb

New Zenner

Join Date:
Sep 2011
Posts:
48
Plugin Contributions:
0

Re: Twitter sidebox Cached

thank you for this plugin
29 Sep 2011, 18:32
#13
soki avatar

soki

New Zenner

Join Date:
Apr 2008
Posts:
85
Plugin Contributions:
0

Re: Twitter sidebox Cached

It not showing greek characters correct! Any fix?
03 Oct 2011, 11:33
#14
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

Probably an error with the encoding.

What is the encoding of your shop? UTF8?
03 Oct 2011, 15:23
#15
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

The Twitter xml feed is UTF-8 encoded. If your shop uses ISO-8859-1 encoding, and you have problems with special characters, try the following fix:

In includes/functions/extra_functions/twitter_cached_sidebox.php:
After:
function twitterTextConverter($text){
  // url2link conversion
  $text = preg_replace("/([^A-z0-9])(http|ftp|https)([\:\/\/])([^\\s]+)/",' <a href="$2$3$4">$2$3$4</a>',$text);
  // shorten long links
  $text = str_replace('>http://www.', '>', $text);

Add:
  // convert UTF-8 to ISO-8859-1
  $text = iconv('UTF-8', 'ISO-8859-1//TRANSLIT//IGNORE', $text);
05 Oct 2011, 21:13
#16
soki avatar

soki

New Zenner

Join Date:
Apr 2008
Posts:
85
Plugin Contributions:
0

Re: Twitter sidebox Cached

It worked!!!! (ISO-8859-7 for the greek)

Thank you very much!:clap:

paulm:

The Twitter xml feed is UTF-8 encoded. If your shop uses ISO-8859-1 encoding, and you have problems with special characters, try the following fix:

In includes/functions/extra_functions/twitter_cached_sidebox.php:
After:
function twitterTextConverter($text){
  // url2link conversion
  $text = preg_replace("/([^A-z0-9])(http|ftp|https)([\:\/\/])([^\\s]+)/",' <a href="$2$3$4">$2$3$4</a>',$text);
  // shorten long links
  $text = str_replace('>http://www.', '>', $text);

Add:
  // convert UTF-8 to ISO-8859-1
  $text = iconv('UTF-8', 'ISO-8859-1//TRANSLIT//IGNORE', $text);
29 Oct 2011, 12:23
#17
entoy avatar

entoy

New Zenner

Join Date:
Oct 2011
Posts:
1
Plugin Contributions:
0

Re: Twitter sidebox Cached

this worked. im using japanese zen-cart. also follow the encoding solution...thanks paulm! this is great contri.
16 Nov 2011, 10:40
#18
willie_bee avatar

willie_bee

Zen Follower

Join Date:
Mar 2011
Posts:
386
Plugin Contributions:
0

Re: Twitter sidebox Cached

When someone is shopping or browsing and they click
the Follow Us icon it changes the screen completely to Twitter's homepage.
How can we make this actually open a separate page? I would think
you wouldn't want your customers to leave your site.
11 Jan 2012, 17:33
#19
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
3

Re: Twitter sidebox Cached

@entoy: thanks for the compliments and feedback that it works on your Japanese site too :smile:

willie bee: to open in a new window you could try to edit the template file and add target = blank to the links like this:
[HTML]<a href="#" target="_blank">[/HTML] (not literally!)
I don't think it's valid HTML strict though, only transitional.

#####################

New version 1.10:
- Tested on Zen Cart 1.5
- Fix for other than 200 http responses from twitter
Now the cache should be used (and not overwritten, as before) whenever the twitter response is not 200.
- Automated character set conversion status (ISO-8859-1,UTF-8)
28 Jan 2012, 09:23
#20
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Posts:
1,780
Plugin Contributions:
2

Re: Twitter sidebox Cached

paulm:

@entoy: thanks for the compliments and feedback that it works on your Japanese site too :smile:

willie bee: to open in a new window you could try to edit the template file and add target = blank to the links like this:
[HTML]<a href="#" target="_blank">[/HTML] (not literally!)
I don't think it's valid HTML strict though, only transitional.

#####################

New version 1.10:
- Tested on Zen Cart 1.5
- Fix for other than 200 http responses from twitter
Now the cache should be used (and not overwritten, as before) whenever the twitter response is not 200.
- Automated character set conversion status (ISO-8859-1,UTF-8)


for anyone wanting to open in new tab here is the code to replace (line 31?) in the template file tpl_twitter_cached_sidebox.php

$content .= '<a target="_blank" href="http://twitter.com/#!/' . TWITTER_BOX_CACHED_USER . '" id="twitter-link">';

:smartalec: