Hi,
I'd like to have a checkbox under my wire posts where we could send our posts to twitter. Has anyone had any luck doing this with 1.8?
Thanks,
Hairy Larry
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
twitter_api auth is a core plugin, so all you really need is to find a php class for twitter and write a few lines of code.
You can use the same twitter API of the core. The users who are already using twitter_api to login to your site, can directly send their wire posts to twitter with a little coding. For other user, they need to have to authenticate their elgg account with twitter first. Anyway you have to do a bit of code yourself..
I haven't got the twitter_api plugin to work with 1.8. Are any others having luck with it? Maybe it's something I'm doing wrong.
That would be the first step. Then it would still have to be coded to forwarded a post to twitter.
I have been extending embed_extender but I have no experience writing plugins. I am an experienced php programmer and I'm always interested in learning something new.
Have you gone thru this in yr 1.8 install ?
Plugin Settings
Twitter API
You must obtain a consumer key and secret from Twitter. Fill out the new app application. Select "Browser" as the application type and "Read & Write" for the access type. The callback url is http://localhost/elgg1810/twitter_api/authorize.
I think this would do the job (haven't tested, just wrote down the code):
start.php
select.php
DhrupDeScoop,
Thanks for the help. I didn't find anyplace to set the application type to browser but I did everything else you suggested and I got it to work. I also had to activate the OAuth plugin but that was explained in the twitter api plugin more info.
Ismayil Khayredinov
I haven't had time to try your code yet but I will. So do I have to install a hypeJunction plugin? I notice it's listed as a package in the comments. So basically the whole plugin will be two files, start.php and select.php? I am totally new to programming plugins but I do code php and I have done a bit of api work.
Thanks,
Hairy Larry
Larry, no extra plugins will be necessary (twitter_api and oauth_api should be enabled). Technically it's 3 files, you will need to include manifest.xml as well.
Thanks Ismayil. I'm going to try it and see if I can get it to work. Hairy Larry
Just an update. I have been working with Ismayil's code with his help by email. Learning a lot about programming plugins. I have the checkbox working but I'm not pushing the tweet to twitter.
Anyone with specific experience of how to do this?
I will update again later.
Thanks,
Hairy Larry
Larry,
Open your console (right click -> inspect element). Choose network. When you save the wire post, you will see add in the list of documents. Look into what parameters are being sent to the form (that will be all the data from your form). Make sure send_wire_to_twitter is sent as well. If it's not sent, then your checkbox is outside of <form></form>.
If the value is sent, then we need to look into the plugin_hook_handler. Something is not being processed there properly.
- Previous
- 1
- 2
- Next
You must log in to post replies.