DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:twitter

This is an old revision of the document!


twitter plugin

Compatible with DokuWiki

Angua, "Adora Belle" Weatherwax

plugin Show tweets or searches from Twitter. previous author Christoph Lang

Last updated on
2013-08-23
Provides
Syntax
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with embed, listing, search, social, twitter, users

Description

This syntax will enable users to put tweets and searches from twitter on a page. It uses the media cache thereby bypassing twitter's tracking cookies and complying with EU privacy guidelines.

Installation

:!: As of 2013-03-08 this requires OAuth credentials

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

After installation you need to create a Twitter application so you can obtain the necessary OAuth credentials (oauth consumer key, oauth consumer secret, oauth token and oauth token secret) which must be entered in the admin page.

Purpose

IF you want to show some tweets from twitter on a DokuWiki page, use this Plugin. The syntax is easy:

[TWITTER:TYPE:USERNAME/SEARCHWORD:COUNT]

Replace the following:

  • TYPE: Valid options are USER and SEARCH: USER will show a timeline of a user and SEARCH will search for a given word on twitter.
  • USERNAME/SEARCHWORD: The name of the user (in USER mode) or word (in search mode).
  • COUNT: The number of tweets to show, when in user mode.

And here comes some valid examples:

//The 5 latest tweets from user schwarzenegger.
[TWITTER:USER:schwarzenegger:5]
//All tweets from user BritneySpears
[TWITTER:USER:BritneySpears]
//Search for the word mj
[TWITTER:SEARCH:mj]
//Search for the word dokuwiki
[TWITTER:SEARCH:dokuwiki]

Information

I created that plugin in around 30 minutes, so it's only a first demo and I personally don't like the look. But at least it's working. I will do some improvements, when I have more free time.

Discussion

I would like to send dokuwiki changes (the changelog) to twitter automatically. How can I do that? citizenkeys 2010/04/17 19:29

That is not possible with this plugin. You would need another plugin to do automatic tweeting of the changelog. The plugin needs to be a action plugin and not a syntax plugin. Currently i'm not havin any plans to realize that, althought it would be really easy because Twitter has a really good API. Christoph Lang
As they say 'better late than never'. I created a new plugin called autotweet that automatically posts Tweets with page changes of specific pages to Twitter using the oAuth authentication protocoll. You can specify the look and feel of the Tweet to suit your needs and also specify which pages should be regarded. I hope this is what you had in mind, maybe it's still usefull to somebody. jdt 2011/10/06 11:10

Can you (or anybody!) please write a plugin to send dokuwiki updates to twitter? Right now, my site has a plugin to automatically send sitemap updates to Google. We would like to send page updates automatically to twitter. citizenkeys 2010/04/17 19:29

I wouldn't even know what to tweet on a page update, because 140 chars not much. Personally i think a rss feed is the much better choice here. But maybe someone will do your plugin Christoph Lang

Nice plugin! But is it possible to make the syntax more *DokuWiki-like*? Such as using user:reder? — Reder 2009/07/04 08:30

Ok, just updated the code. Now you can also use:
//Timeline of user
{{twitter>user:reder}}
//Search for Keyword 'PHP'
{{twitter>search:PHP}}

Hope that helps.


I build some regex into the Plugin to make links, twitterer and hashtags clickable. rifter 2009/07/08 17:56

Thank you, seems to work very fine!

Christoph Lang 2009/07/08 23:46

Updated the code a little bit, mainly the time of the tweet is now displayed Twitter-like, e.g. 5 minutes ago, or About 1 week ago. Also there was a problem with the regex (only first hastag was clickable). Now all hastags are clickable. Christoph Lang 2009/07/09 23:01

Getting a “Twitter is down” error when it isn't. — Grimp
“Twitter is down” means either Twitter is down, or the response from Twitter is invalid. Maybe you used a wrong syntax?
Give me a sample of your syntax, and I will look. Maybe it's a Bug. — C.Lang
I have the same problem “Twitter is down” … example on http://pichat-wiki.de/links#twitter — Mark Wolfgruber
In you PHP.ini the option allow_url_fopen is Off. You have to turn it On, so that the Plugin can fetch the data from Twitter.
If Option is Off file_get_contents can only open local files, and not files on another server. — C.Lang
I can't change the parameter for allow_url_fopen to On
but now it is working with the following additional function code
to install put the private function file_get_contents e.g. top of the function handle
replace in the function handles: file_get_contents with $this→file_get_contents
Mark Wolfgruber 2009/11/23 02:42

I updated the mod, now you can use allow_url_fopen with ON or OFF (I need for local Installation ON and for the Server OFF) — Mark Wolfgruber 2010/04/23 00:16

Fantastic plugin, thanks - is there a way to do negative keywords on the search? (UPDATE 7/22 - WORKED! THANKS CHRISTOPH!) — Tyler (mail at tribalcore dot com)

Just updated the plugin. Now you can combine searchwords, e.g:
//Search for PHP but NOT Zend
{{twitter>search:php -zend}}
//Search for PHP AND Zend
{{twitter>search:php zend}}

In theory other search parameters from the Twitter-Api should also work, but I didn't test it.

This requires PHP 5.2 or later, or alternatively you'll have to add a json_decode function, e.g. from http://au.php.net/manual/en/function.json-decode.php#91216 — Robert

Your plugin does not work on my server. It shows only: About 40 years, 1 month ago from. (www.pyload.org/beta)
Johann Bauer

It seems your server is returning the wrong time to the plugin. 01.01.1970 is the start of the UNIX time, and that is what your server is returning (40years and 1 month ago).
Maybe you have to set the correct time on your server first. — C.Lang

No, the server's time (So 7. Feb 17:49:24 CET 2010) is right (for Germany) and there aren't tweets and pictures, so that I think it's another problem

Just checked your site pyload and saw that it wasn't working. Seems your having another problem. Do you have at least PHP 5.2?
Maybe you can provide me with more detailed information, because I can't think of any reason for your problem.
You can also contact me via Email, my mail address is on top of the page (I'm German, too).
Updated the plugin with cache “management” (from source plugin).

Björn Kalkbrenner 2010/06/18 20:15

plugin/twitter.1400051738.txt.gz · Last modified: 2014-05-14 09:15 by mprins

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki