Twittercast: Shoutcast / Icecast Song Title To Twitter Status PHP Script

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Wavestreaming
    Major Dude
    • Apr 2004
    • 1563

    #16
    Pretty cool!

    I've been considering creating something similar to offer our clients and I'll probably add this script to our resources area. Twitter is a growing community and can prove a great marketing tool - especially given that Twitter openly allow people to use it for commercial purposes.

    I actually had a chat with our web developer about using twitter for marketing a radio station a month or so back for Talkwebcasting; http://www.youtube.com/watch?v=FTWxnMGx3zA

    By the way, any twitter people who'd like to follow us, feel free! http://twitter.com/wavestreaming
    Wavestreaming | Shoutcast Hosting | Auto DJ |
    How To Start An Internet Radio Station

    Comment

    • aaronsnet
      Member
      • Mar 2004
      • 66

      #17
      Originally posted by dopelabs
      thats why it writes the title info to title.txt it checks that for differences and will only post to twitter if there is a 'new' song.

      yea maybe the song title has a ' in it...
      I was just saying that that script is not necessary to do that because if you sent the same post x2 or more in a row, Twitter will automatically ignore it and not repost it over and over.
      the detour network - detour MUSIC, detour TALK

      Purple Zebra Consulting-http://purplezebra.us
      Supporting independent internet radio stations since 2001!

      Comment

      • dopelabs
        Major Dude
        • Oct 2006
        • 539

        #18
        Originally posted by aaronsnet
        I was just saying that that script is not necessary to do that because if you sent the same post x2 or more in a row, Twitter will automatically ignore it and not repost it over and over.
        correct BUT since the new version also includes the listener count, it will be different each time the script executes. thus requiring the check =]

        Comment

        • Michael T.
          Member
          • Nov 2004
          • 99

          #19
          Originally posted by dopelabs
          The way this works is. the script will check the shoutcast server for the currently playing song. It then checks the title.txt for the same title info... if the title.txt file is empty, or it has different title info, it will send that data to twitter, and it will also write that to the title.txt file.

          This script will ONLY update the title info if its different from the last time it checked, thus not posting the same title every min. (or however long you set your cron job for)

          here is an example of a cron job that could be used:

          */10 * * * * wget -O /dev/null http://www.domain.com/twittercast.php >> /dev/null 2>&1

          things to keep in mind:

          make sure the title.txt file is writable by your webserver (chmod 777 title.txt) and in the same directory as everything else.

          make sure there actually IS title info on your shoutcast server..

          just visit your shoutcast server in your browser to check that.


          I am also posting a new version.

          Changes:

          Support for multiple servers
          Added listener count to twitter output
          Added page refresh for automatic in-browser updates


          see working examples at www twitter com / dubstepfm
          That looks pretty cool. Just edit the
          $twitter_username ='username';
          $twitter_psw ='password';
          section of the twitterAPI with my twitter username and password?

          and edit the
          // High bitrate
          $ip[1] = "123.123.123.123";
          $port[1] = "8000";

          // Medium bitrate
          $ip[2] = "123.123.123.123";
          $port[2] = "8002";

          // Low bitrate
          $ip[3] = "123.123.123.123";
          $port[3] = "8004";?

          section of the twitter_multi file with the server addresses and upload? I want to make sure I understand it all before I upload.
          Last edited by Michael T.; 28 February 2009, 16:29.

          Comment

          • dopelabs
            Major Dude
            • Oct 2006
            • 539

            #20
            Originally posted by Michael T.
            That looks pretty cool. Just edit the
            $twitter_username ='username';
            $twitter_psw ='password';
            section of the twitterAPI with my twitter username and password?

            and edit the
            // High bitrate
            $ip[1] = "123.123.123.123";
            $port[1] = "8000";

            // Medium bitrate
            $ip[2] = "123.123.123.123";
            $port[2] = "8002";

            // Low bitrate
            $ip[3] = "123.123.123.123";
            $port[3] = "8004";

            section of the twitter_multi file with the server addresses and upload? I want to make sure I understand it all before I upload.
            Looks like you got it... if you have any problems you can PM me or ask in this thread =]

            cheers

            Comment

            • Michael T.
              Member
              • Nov 2004
              • 99

              #21
              I thought I had this figured out but it will not post to my twitter page.

              Comment

              • odogg
                Member
                • Jan 2004
                • 77

                #22
                I get it to say the song title on the web browser but it still don't post to Twitter. I have the login info correct. Puzzling...
                Odogg
                Dogglounge Internet Radio
                Streaming Deep House Music 24/7
                www.dogglounge.com

                Comment

                • Michael T.
                  Member
                  • Nov 2004
                  • 99

                  #23
                  I've experienced this to. I figured out that I needed the twittercast_multi.php open and my twitter page open at the same time for song to post. Try that. I hope it helps.

                  Comment

                  • dopelabs
                    Major Dude
                    • Oct 2006
                    • 539

                    #24
                    i dont seem to experience this... i dont have either page open in my browser and it updates for me just fine. i use a cron job to access and run the script from the command line.

                    Comment

                    • odogg
                      Member
                      • Jan 2004
                      • 77

                      #25
                      I have a cron job hitting it every 5 mins as well but no go. Can you tell us what your file permissions are set at? Mine are at 644 except the txt file which is 777. I'm thinking maybe I need to chmod the .php files to at least 744.
                      Odogg
                      Dogglounge Internet Radio
                      Streaming Deep House Music 24/7
                      www.dogglounge.com

                      Comment

                      • odogg
                        Member
                        • Jan 2004
                        • 77

                        #26
                        Okay I figured it out, you gotta be sure to have the Curl PHP module installed or else no go. So, if anyone else out there has the same problem install Curl or contact your web host to have them do it.


                        Cheers!
                        Odogg
                        Dogglounge Internet Radio
                        Streaming Deep House Music 24/7
                        www.dogglounge.com

                        Comment

                        • Michael T.
                          Member
                          • Nov 2004
                          • 99

                          #27
                          I'm not familiar with curl.

                          Comment

                          • fc*uk
                            Moderator
                            • Dec 2005
                            • 8140

                            #28
                            Where are you having problems with respect to curl?

                            See the manpage if it is a general problem: http://curl.haxx.se/docs/manpage.html
                            Trancectro/electro-house/electro | Are You Hard?

                            Comment

                            • odogg
                              Member
                              • Jan 2004
                              • 77

                              #29
                              My only problem was not having the curl php module installed on the web server. It's installed now and everything works fine.
                              Odogg
                              Dogglounge Internet Radio
                              Streaming Deep House Music 24/7
                              www.dogglounge.com

                              Comment

                              • AKAradio
                                Junior Member
                                • Aug 2004
                                • 2

                                #30
                                is there anyway to modify this so that it only tweets DJ changes? Ive found that people like the tweeting we are doing but soon get tired of all the song updates. DJ changes would keep us out there, just not as such a high volume...

                                Thanks!
                                Eric

                                Comment

                                Working...
                                X