It's better when it's simple

User Tools

Site Tools


twitter Plugin

Compatible with DokuWiki

  • 2017-02-19 "Frusterick Manners" yes
  • 2016-06-26 "Elenor Of Tsort" yes
  • 2015-08-10 "Detritus" yes
  • 2014-09-29 "Hrun" yes

plugin Show tweets or searches from Twitter (previous author Christoph Lang)

Last updated on

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


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.


:!: 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.


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


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.
//All tweets from user BritneySpears
//Search for the word mj
//Search for the word dokuwiki


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.


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 search?q=user%3Areder&btnI=lucky? — Reder 2009/07/04 08:30

Ok, just updated the code. Now you can also use:
//Timeline of user
//Search for Keyword '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 — 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 — Robert

Your plugin does not work on my server. It shows only: About 40 years, 1 month ago from. (
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

Hi i can't make work your plugin, i have this error message : “Twitter error… 215: Bad Authentication data.” do you have an idea where this come from ? — AdrienAdrien

2015-11-17 15:56

probably the credentials that you entered are wrong; see the installaion above, optionally create new keys for this application
I would agree here. Your application needs to be 'Read' on Twitter. Then remake the tokens. Worked for me.

It is worth noting that something in this plugin is not compatible with HTTPS / SSL. I think it may be an unencrypted element e.g. an image, possibly the Twitter avatar? Any help?

plugin/twitter.txt · Last modified: 2017-05-09 11:37 by mprins