Lenfis bLog Computer, Coffee & Co

RSS2Teamspeak3

RSS2Teamspeak is a small PHP command line script that is supposed to run with cron to push RSS feeds into Teamspeak 3 channels. It uses and needs MagpieRSS as RSS library and the TS3 PHP Framework to connect to the TS3 server. Features include caching through MagpieRSS, remembering already posted articles through the pubDate and the GUID and posting a feed to one or more channels or to all logged in users.

Download

Installation

  • Download RSS2TS3, MagpieRSS and TS3 PHP Framework (or get Magpie it through your distributions package management) and extract all archives.
  • Open rss2ts3.php with an editor. You need to adjust at least the following settings:
    • Teamspeak server settings ($config['ts'])
    • Path to the libraries below the teamspeak settings
  • RSS feeds are set up in the $config['feeds'] array. So the first feed is in $config['feeds'][0], the second in $config['feeds'][1] and so on...
    // feed url
    $config['feeds'][0]['url'] = "http://rss.kicker.de/news/aktuell";
    // the channel ids to send the message to. For example to
    // send the feed posts to channels 12 and 19, use the
    // following setting:
    // $config['feeds'][0]['cid'] = array(12, 19);
    $config['feeds'][0]['cid'] = array(38, 18);
    // if set true, instead of sending the message to the
    // channels, send it to all connected clients.
    $config['feeds'][0]['allclients'] = true;
  • If you leave the username and password section empty, you most likely won't have enough rights to send messages to the whole server, check the FAQ below. (Depends on your server setup...)
  • Last but not least you'll need to setup a cron job that runs the script periodicly. (On windows or mac you might need to do something different, if you figure it out, I would appreciate a comment.)
    For me the following job works, running the script every 15 minutes:

    */15 * * * *          php /home/lenfers/kram/apps/rss2ts3.php

F.A.Q.

  • I've got a webserver with PHP. What do I need to do to run RSS2TS3?
    I wrote the script as a command line tool, it isn't supposed to run through a webserver and present output there. Maybe someone finds a solution for users on webhosters. If you can define cron jobs in your package, you should be good by following the instructions above.
  • TS3 has no username/password pairs. Where do I get the username and password for RSS2TS3?
    You can create new server query users as described here.
  • I created a user as described above, but I still cannot send messages to the whole server.
    Thats most likely because your user doesn't have the b_client_server_textmessage_send b_client_channel_textmessage_send permissions set.
Kommentare (7) Trackbacks (0)
  1. I am trying to do this and have everything setup but it is saying it can’t find the Teamspeak3.php file. Why is that?

  2. Did you download the TS3 PHP Framework as stated above? And set the path right?

    I have to admit that this never interested many people and I discovered fast that I myself don’t have any use for it. Therefore it is still in early alpha and I don’t plan to change that anytime soon.

  3. I am using the Ts3 php file and it is pointed to the righr directory so I don’t know what is happening.

  4. I just checked, the library paths didn’t change. Did you really download http://www.planetteamspeak.com/component/option,com_docman/task,doc_details/gid,105/Itemid,70/ and pointed PATH_TO_TS3PHP where you extracted it?

  5. I did download it and the PATH_TO_TS3PHP is pointed in the right direction. /home/lenfers/kram/apps/ts3_php I made this directory on my server. THis is the error I am getting http://chaoticevo.com/rss2ts3/rss2ts3.php

  6. Are you using a shared hoster or a root server? It seems to me you are on a shared hoster, where it is really unlikely that you are able to create “/home/lenfers”. But you dont need to, just change it into any directory you like, it is just an example!

    But are you able to run cron on your server?

    And please beware: This is really only a proof of concept! Its alpha software, only use it if you can cope with the problems!

  7. Yes I am able to run cron stuff on the server it gives the same error like the link I gave you. Let me try a different directory and see if I can get it to wrok.


Leave a comment

(required)

Noch keine Trackbacks.