Twitter push for The wire v1.1

Release Notes

This is a simple plugin that provides the ability to push public messages from The Wire to Twitter.

It is the same one that is currently used on the community site.

Only public Wire messages are pushed.

Twitter recently made changes to their API. This version contains a very minor tweak to David Grudl's twitter class which lets it talk to twitter without generating a 417 error response.

  • could you explain in a bit more details how to activate the service between the two as my installation doesn't seem to push or let me setup any connection

     

  • You need to activate it, and then go to "Settings -> Configure your tools" and then enter your twitter username and password.

    Once done it'll forward any public wire post that you make to twitter.

  • Thank you for the update!

  • This package requires cURL extensions, which some shared hosting providers do not enable.  Can you make it work without cURL?

  • Muahaha, got it working with the curl command (almost always installed) but without PHP curl extensions (not always installed in shared hosting).

    Instead of importing twitter.class.php (which requires curl extensions and is quite heavy anyway), I changed the twitterservice_send() function to this:

    exec('curl -u ' . escapeshellarg($twittername) . ':' . escapeshellarg($twitterpass) . ' -d status=' . escapeshellarg(urlencode($twittermessage)) . ' http://twitter.com/statuses/update.json' );

    Not too pretty... but it works.  It would probably be better to use pure HTTP to query Twitter.

    You can check it out at:  http://oakpages.com.

  • Quite possibly should use native http... the twitter class isn't terribly complicated so if I get a free moment I might hack together a non curl version.

  • I have installed the latest version of the wire and the twitterservice plugins and activated them both. However, under "Settings" I do not have an option to "configure your tools". I only have:

    • Change your settings
    • Edit profile icon
    • Account statistics

    We are still on Elgg 1.0. Do we need to update to Elgg 1.2 to see this under 'Settings'?
  • Does this work with The Wire v2.01 and up? Or only 0.5?

  • Any luck on making HTTP calls directly without using curl libraries?  If not, I might be able to look into it.

  • Hi, I have curl extensions enabled and also have set my twitter username under "Settings -> Configure your tools". I still don't see it pushing messages to twitter.

  • Hi, I have tested using send.php and the mod is working fine so you can ignore my previous post. More than likely mine is a firewall issue.

  • Actually, send.php works. still can't get it working from the wire. Any ideas?

  • Ok got it working with the following change to mod/twitterservice/start.php

    original:
    if (($object) && ($object->subtype == get_subtype_id('object', 'thewire')) && ($object->access_id == 2))

    modified

    if (($object) && ($object->subtype == get_subtype_id('object', 'thewire')))

    Now need to work out why I had to remove the access_id...

  • Looking at the elggriver table in the database

         type        subtype       action_type          access_id     view
         object     page_top     create                   2                  river/object/page/create
         object     thewire        create                   0                  river/object/thewire/create

     

    If I set the accessid in start.php to 0 instead of 2 it works

    if (($object) && ($object->subtype == get_subtype_id('object', 'thewire')) && ($object->access_id == 0))

  • The access_id test makes sure that only public messages are pushed to twitter - setting the access_id test to 0 means that only PRIVATE messages will be pushed (not ideal).

    Make sure that you are sending PUBLIC messages - only these will be pushed to twitter.

  • My current dashboard settings are: the wire: access public.

    Or is there somewhere else that I should set the public setting?

  • Ok found the issue. The default access permissions setting in

    administration > site administration > default access permissions

    needs to be set to public.

    It appears that this over rides any setting in the wire.

     

  • Has anyone uppgraded this to work with 1.5?

  • Can anyone confirm this version works with Elgg 1.5 ?

  • i think in 1.5 the wire now has this native without needing this plugin. once the wire is enabled, go to settings and see the "twitter service" box.

  • @jbvk I disabled the twitterservice plugin and checked the settings tab. I do not see a twitter service box. So, I do not think that this is included within 1.5. Am I missing something? Where are you going to see this? Do you have the twitter service enabled, as this is a standard plugin when you download elgg1.5 now.

    As far as the comments on this not pushing to twitter. I figured out why this isn't working on my site. Under Settings -> Change Your Settings -> Your Default Access Level    

    this needs to be set to public for your wire post to be sent to twitter. Now this is only possible for users to do if the site admin has set Administration -> Site Administration -> Allow User Default Access

    Now here is an idea for you developers out there. For this plugin to be most effective, could it modify the wire post section to give the user the option to select who can see the post (Logged in users, friends, public, private, etc.). This way the user doesn't need to check to make sure that their default setting is public to make sure that they can post to Twitter. That also gives them the ability to do this if the site administrator has not checked the "Allow User Default Access" box and the default that the admin has set the site to is logged in users. Make sense?

    PS Anyone know a plugin or widget out there that can put the wire box on a page? Kinda like what facebook has so that people can post to the wire directly from their profile or their dashboard without having to go to Tools -> The Wire?

  • To answer my PS, I can see that once you have posted to the wire, you are able to update the status from your profile. But, until the user has actually posted to the wire, this option is not available. Sorry for a request about a different plugin on this plugin's message board. 

  • @ChristopherW. Sorry to confuse the issue. You are right. I have twitterservice enabled. And thank you also for clarifying how to get Twitter to pull the wire post. I was having difficulty with that and your clear steps guided me to the solution. I agree re users needing to check that their default setting is public. And I wonder if now there will be items which will slip out to public view (other than wire pushes to twitter) which the user will not intend for public view. A solution that addresses that would be helpful. Thanks again.

Marcus Povey

Former Elgg project technical lead, now freelance, have laptop, will travel. Creator of Elgg Multisite. Available for hire!

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 2820
  • Recommendations: 0

Other Projects

View Marcus Povey's plugins