Business, Tech, Life, and Whatever else

Classifieds Twitter Feeder

by Eric Barnes on March 14, 2009

68 Classifieds Twitter Feeder

If your an avid Twitter user or looking for more ways to market your site then this classifieds Twitter feed module is for you. It is a module that enables your 68 Classifieds site to automatically make a tweet with each new listing added to your site. This is the first release of this module and it is considered beta. So use it at your own risk and report any issues to me.

Some of the features of classifieds twitter feeder are:

  • Works automatically in the background. Set it and forget it.
  • Uses the is.gd url shortening api service.
  • It uses the status of the listing to determine if it should be sent. So unapproved listings will not be posted.
  • Creates a field to flag which listings have been sent. This is to prevent any duplicates.

Requirements

The Classifieds Twitter Feeder requires 68 Classifieds v4.1.7 and PHP 5 or better with cURL installed.

Instructions

Download the zip file and extract it.

Open twitter/settings.php and enter your Twitter username and password.

Upload the “twitter” folder to your modules directory.

Finally visit administration -> manage modules -> activate.

If you are running a version less than 68 Classifieds v4.1.7 then you will need to make this manual change. (Requires Developer Edition)
Open includes/classes/kernel/Listings.php and find:

$data=array('id'=> $id, 'status'=>$status);
$modules->call_hook('change_display_status', $data); // Call any module functions

Replace with:

$data=array('id'=> $id, 'status'=>$status, 'orderid'=>$orderid);
$modules->call_hook('change_display_status', $data); // Call any module functions

Errors

If you are getting a mysql error when adding listings then it is a good chance a new row wasn’t added to the listing table during the install. I have had a few reports of this. To fix it you can manually run this query in phpmyadmin:

ALTER TABLE  `class_listings` ADD  `tweeted` INT( 1 ) NOT NULL DEFAULT  '0';

Change class_listings to match your table prefix.

No Listings Sent to Twitter

Since v0.3: If you are having trouble getting listings sending to Twitter then you can open twitter/hooks.php and find:

var $debug = false;

Then change it to true.

Change Log

  • v0.6 September 14, 2009 – Had to use a new hook which should fix it from not running.
  • v0.5 August 27, 2009 – Removed a few hooks will hopefully run fully now.
  • v0.4 August 26, 2009 – Fixed an error causing the admin to shut down
  • v0.3 August 25, 2009 – Added debugging code
  • v0.2 March 27, 2009 – Bug Fixes
  • v0.1 March 14, 2009 – First Release

Help & Support

This is a free plugin and I make absolutely no guarantee I can offer support. If you find any bugs please report it to the Issue Tracker.

Download

Download | SVN | Donate

You May Also Be Interested In...

Building a news module – 68 Classifieds
July 1, 2009

Rating Module
February 11, 2009

68 Classifieds Twitter Feeder v0.3
August 25, 2009

Multi Purchase Module
March 3, 2009

Subscribe Now

If you enjoyed this post, you will definitely enjoy my others. Subscribe to the feed to get instantly updated for those awesome posts soon to come.


  • metrony
    This would be great to be able to assign the twitter feed for listings belonging to specific packages. This will allow me to offer additional incentives to use a paid package.
  • steven
    Hi got this working cheers
  • steven
    Hi
    i am using the latest version of 68 and the it seems like the tweet is sent when listing item, however when i access twitter nothing shows. Do i have to enable anything on twitter to allow this module to work.

    cheers
  • Eric,

    Do you happen to have a version of this classifieds twitter system that is compatible with PHP 4.4.7? That is the version I have on my server and to install PHP 5 would require a LOT of recoding of existing systems that we run. Thanks so much! I really hope to be able to use your system soon. Great concept!
  • No sorry. You might could recode for php 4 support but that is not something I am willing to take on right now.
  • ismail
    the listing are tweeted even if they are not approved... they appear in twitter as soon as user submits listing.
  • So you are using manual approval from admin?
  • Eric - I am using v4.1.6 which is the latest I see on the 68Classifieds site but the designer version. Does this mean I have to buy the developer version to get this mod to work? I installed the mod and have PHP 5+, cURL installed but when I put up a new listing it is not showing in the twitter feed. Any suggestions?
  • Yes it will require the developer edition until v4.1.7 comes out. This will be out probably in a few weeks if you don't mind waiting.
  • Great! I will wait for 4.1.7.

    Thanks!
  • thanx alot for shareing
  • A new release of this Twitter module has been made and I am really hoping this fixes the issues for those having trouble getting it to send. This release does require v4.1.6 of 68 Classifieds because it needed a new hook.
  • Thank you Eric for working on this; it seems like agreat thing for our sites.
  • I wanted to let everyone know a new release of this mod will be made this week. I found a few issues that needed to be fixed and a new hook that will only be in 68c v4.1.6 which was just released.
  • I've been trying this module for a week or two now and I keep getting:
    Attempting to tweet it...
    Setting up twitter class...
    Checking if the listing is already tweeted...
    and then nothing. Nothing is sent to my Tweeter account and none of the listings are marked as tweeted.
  • Hello Eric, Thank you for the quick response. I did have that turned on and I am seeing no errors from the twitter Mod. Let me know if you want me to take a screen shot and email it to you or if there is anything else I need to be looking at.

    Ian
  • Hello Eric,

    Hey, Appreciate you having the idea to integrate twitter and our auctions...thank you. I downloaded the software 2 days ago and followed directions. My site is getting to the

    Attempting to tweet it...
    Setting up twitter class...
    Checking if the listing is already tweeted...

    and then not doing anything after that.... Anything I should be looking out for or doing to correct this? Thanks in advance and have a great day!
  • Hi Ian,

    Can you try this. Go to administration -> settings -> modules and activate the "debug" module then place another test listing.

    The debug module will turn your error reporting to its highest level and also display info at the bottom of the page. Hopefully this will pinpoint any errors that are being hidden.
  • I wanted to let everyone know I just released v0.5 of this module which I am really hoping has it fully fixed and working. I have been struggling with this module over simple stuff that should have never made it into the first release. :( But live and learn I guess. ;)
  • For any others having issues with it not sending to Twitter I believe the issue is related to the curl setup. I have redone the Twitter class file and you can get the updated version here:
    http://elbmods.googlecode.com/svn-history/r92/twitter/trunk/twitter/Twitter.php.

    I will be making a new release with this change probably tomorrow.
  • It don't works.

    I try live with my web site, and - at the thanks page - I got a blank page with:

    ///////////////

    Attempting to tweet it...
    Setting up twitter class...
    Checking if the listing is already tweeted...
    Trimming Title...
    Shortening URL...
    Sending Tweet...
    CONGRATULATIONS: Tweet Sent...
    Attempting to tweet it...

    And stop it there..

    Sorry for this "bad" report Eric! ;)
  • I sent you an email please let me know if you didn't get it.
  • More than likely. That error means curl is not installed on the machine you are doing the testing with. I would estimate probably 90% of all hosts have this installed by default.
  • I try the V0.4 on local, and when I complete the listing and I got to the thanks.php page, I got a blank page saying:

    ///////////////////////
    Attempting to tweet it...
    Setting up twitter class...

    Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\mywebsite\modules\twitter\Twitter.php on line 31
    //////////////////////

    This is just an error beacouse I'm running the test on local machine?

    Gianluca
  • V0.4 is now released. It fixes the issue Josh reported.
  • Something is still not right. I upload it and then it wont let me get into my admin panel of my site. Then I delete it through the control panel and I can get into my admin panel again.
  • Rebuild is completed and a new version is released. For all those having problems please download it as I fixed a few bugs and added debugging support.
  • As soon as I get some time I will rebuild this with better debugging included so you can turn it on and see exactly what is going on. Right now it seems to be hit or miss.
  • I also added it and Im not getting anything showing up on my twitter account.
  • I don't know, it's very strange...

    1. my username and password are correct.
    I wrote something like that in my settings.php file:
    $user ='myusername';
    $pass ='mypassword';

    2. Server is running on php 5.1.6
    3. curl support is enabled..

    I start on suppose that there is some issue with other module installed..

    Strange..

    Don't worry on solve that, it's just a "little" problem.

    Thanks anyway!

    Gianluca
  • Approved listing are set to 1, and approval setup is automatic; that is: when an user reach the "thanks.php" page his listing is automatically approved.

    So, I don't understand what's it's wrong..

    Gianluca
  • If it is updating the column then I have to think it may be tied to one of these:
    1. The twitter username and password are incorrect.
    2. Your server is running php less than v5.
    3. Your server does not support curl.
  • Just nothing.

    I saw the database, and the new row just say "tweed" in every new listing, but it don't pass nothing to tweeter.

    Tell me if you need something to "investigate".

    Thanks!

    Gianluca
  • When you view that row do you see a 1 in any columns or are they all just 0?

    Also how is your approval setup? Automatic or only from admin?
  • Hi Eric,

    and what about my post?
    I try your module on my web site, but no listing are "feed" to twitter.

    Thanks!

    Gianluca
  • Hi Gianluca,

    Sorry I missed it. Are you getting any errors? Or just nothing?
  • @adam - Good idea. I think that would be very easy to do without even needing a module. Just create a link like:

    Post to Twitter
  • Any plan to allow users to tweet listings to their profiles automatically?
  • Hi Eric,

    I try this module, but it don't send anyrhing to Tweeter..

    Can you check it?
    It will be a very nice add-on!

    See you,

    Gianluca
blog comments powered by Disqus