Airtime And Twitter/FaceBook/Google+ integration
  • Vote Up1Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    someone have a idea for an automatic posting system (for programs info) directly from airtime ?
  • 21 Comments sorted by
  • Yep. This can be done with a little liquid soap script hack. You can put
    your handler on track change and invoke a script posting current metadata
    via social services API.

    С уважением, Станислав Ханжин-Цветков.
    15.03.2013 18:46 пользователь "Albert FR" <<br />airtime-dev@lists.sourcefabric.org> написал:

    > someone have a idea for an automatic posting system (for programs info)
    > directly from airtime ?
    >
    >
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    have you an example ?
  • May be I'm misunderstanding something here. The previous solution was for
    track change notification. If you want to notify your SN accounts about new
    shows in calendar, then you need some different hack.

    С уважением, Станислав Ханжин-Цветков.
    15.03.2013 19:18 пользователь "Stanislav Hanzhin-Tsvetkov" <<br />airtime-dev@lists.sourcefabric.org> написал:

    > Yep. This can be done with a little liquid soap script hack. You can put
    > your handler on track change and invoke a script posting current metadata
    > via social services API.
    >
    > С уважением, Станислав Ханжин-Цветков.
    > 15.03.2013 18:46 пользователь "Albert FR" <<br />> airtime-dev@lists.sourcefabric.org> написал:
    >
    > > someone have a idea for an automatic posting system (for programs info)
    > > directly from airtime ?
    > >
    > >
    >
    >
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    that's effectively i want to do ;-)
  • I've seen folks establish a Twitter accounts strictly for issuing Artist/Track updates. On the surface, that seems pretty neat! On the other hand, publishing an unlimited rolling timeline probably has more negative consequences than positives! Do you really want FB or Twitter owning this information? Facebook is about kaput (no really), Twitter still has no viable business model, and Google probably already pwns your email. Just my 2¢ :ar!
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    not all songs ;-)
    only shows
    I'm not crazy :D
  • Hi All,

    any progress on this argument?
    We're starting a music promotion service and our customers are asking us for tweet automatically information from Airtime.

    Any ideas?

    Thanks.

    Dario
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    In fact the only solution is to code an xml parser from weekly programs and push them in time to twitter

    more informations here : http://sourcefabric.booktype.pro/airtime-23-for-broadcasters/exporting-the-schedule/
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    I would be inclined to use the live-info API and use nextShow:

    "nextShow":[{"id":"9","starts":"2013-06-20 17:00:00",

    to tweet the next show name, time and URL a few minutes before show start. That way, your fans have time to respond to the tweet, retweet and still catch the beginning of their favourite show.

  • right, but can you set it up to tweet automatically (for instance every 15
    min before the show starts)?


    On Thu, Jun 20, 2013 at 11:33 AM, Daniel James <<br />airtime-dev@lists.sourcefabric.org> wrote:

    > I would be inclined to use the live-info API and use nextShow:
    >
    > "nextShow":[{"id":"9","starts":"2013-06-20 17:00:00",
    >
    >
    > to tweet the next show name, time and URL a few minutes before show start.
    > That way, your fans have time to respond to the tweet, retweet and still
    > catch the beginning of their favourite show.
    >
    >
    >
    Airtime Lead
    Head of Products at Sourcefabric
    *-*
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    that's effectively the good way to do
    you can do that with a cron task

    an php example (for twitter) :

    http://www.sbprojects.com/projects/raspberrypi/tweet.php
    Post edited by Albert FR at 2013-06-20 05:58:09
  • Would love an example of how to do per-track change (most of my shows are indeed tracks so would work) from Airtime to Twitter...looked at the API but no idea how to turn that into a tweet.
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    you need to parse xml datas from your radio, for example

    radio.myradio.org/api/live-info/?callback

    searching the tag NextShow and taking all informations needed like name, url, timestamp
  • Keep us in the loop how you go with this Tim!
    Let me know how we can help!

    Best,
    Lisa.


    On Fri, Jun 21, 2013 at 3:06 AM, Tim RadioClash <<br />airtime-dev@lists.sourcefabric.org> wrote:

    > Would love an example of how to do per-track change (most of my shows are
    > indeed tracks so would work) from Airtime to Twitter...looked at the API
    > but no idea how to turn that into a tweet.
    >
    >
    Airtime Lead
    Head of Products at Sourcefabric
    *-*
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    that's not so difficult Lisa ;-)
    only need a little time to code it ;-)
  • A fast way I found to tweet track data was to pull from the icecast server , via cron every few minutes..(or if you wanted to post on demand) but you could just as easily use api. .. I can forward script if you like  ..

  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    sending from icecast can't be useful, track identification is impossible

    no, the good way is to parse
    /api/live-info/?callback



    and tweet them after
  • artist and title 

     

    $listen = '<a href=\"
    http://x.com:80/din0.m3u\"></a><br />';

     $msg = http_get("http://fx.com/getstatus.xsl"); // print_r($msg);
     $spl = explode( '<pre>', $msg ) ;
     $spl = str_replace( '</pre>', '', $spl[1] ) ;
     $spl = explode( "<br/>", $spl ) ;
     $flds = $spl[0] ;
     $spl = explode( "\n", $flds ) ;
     array_shift($spl) ;
     // print_r($spl);
     // Build stations information.
     $stations = array();
     // print_r($stations);
     foreach ( $spl as $e ) {
        // echo "xxx$e"; echo  "\n";
        if ( ($e !== " _END_") && ( $e !== " ") && ( $e !== "") && ( $e !== " MountPoint,Server Name,Description,Data Type,Bitrate,Quality,Video Quality,Frame Size,Frame Rate,Listeners,Peak Listeners,Genre,Server URL,Artist,Title" ) )  {
        // Only for valid stations, reject empty and marker tags
           $p = explode( '|', $e );
        // print_r($p);
        $stations[$p[0]]['Name'] = $p[1] ;
        $stations[$p[0]]['Description'] = $p[2] ;
        $stations[$p[0]]['Listeners'] = $p[9] ;
        $stations[$p[0]]['Peak'] = $p[10] ;
        $stations[$p[0]]['Artist'] = $p[14] ;
        $stations[$p[0]]['Title'] = $p[13] ;
        }
        //print_r($stations);
     }
     // Prod playlist information first...
     $curtitle = $stations[$fall]['Title'] ;
     $curartist = $stations[$fall]['Artist'] ;
     $listeners = $stations[$fall]['Listeners'] ;
     $peak = $stations[$fall]['Peak'] ;
     $stream = $stations[$fall]['Name'] ;
     //echo $listen . "\n" ;
     if ( !empty( $stations[$prod]['Name'] ) ) {
        $curtitle = $stations[$prod]['Title'] ;
        $curartist = $stations[$prod]['Artist'] ;
        $listeners = $stations[$prod]['Listeners'] ;
        $peak = $stations[$prod]['Peak'] ;
        $stream = str_replace( 'on DinRadio', '', $stations[$prod]['Name'] ) ;
     }
     // Sanitize information, just for being sure it looks nice

  •  or the api is something like this

     

    $json_string = json_decode(file_get_contents('http://fx.com:8080/api/live-info'),TRUE);
    //print_r($json_string);
    $array =(array_values($json_string));
    //print_r($array);
    //print_r(array_count_values($array));

    if (empty($array[2]['name'])||empty($array[3]['name'])||empty($array[4]['name']))
    {
    exit(0);
    }

    $now_ttitle = ($array[3]['name']);
    $now_end =  ($array[3]['ends']);
    $now_strt = ($array[3]['starts']);
    list($now_artist,$now_ttitle) = explode(" - ",$array[3]['name']);
    $next_ttitle = ($array[4]['name']);
    $next_end =  ($array[4]['ends']);
    $next_strt = ($array[4]['starts']);
    list($next_artist,$next_ttitle) = explode(" - ",$array[4]['name']);
    $prev_ttitle = ($array[2]['name']);
    $prev_end =  ($array[2]['ends']);
    $prev_strt = ($array[2]['starts']);
    list($prev_artist,$prev_ttitle) = explode(" - ",$array[2]['name']);
    //print_r($array);
    //print_r(array_keys($json_string));

     

  • this works with airtime api.. just add bitly,twitter keys and comments to suit.. uses php twitteroauth so you need to install latest version, and set path. its not perfect but should work for next show as well with change to arrays parameter... could either run from cron or get ajax/javascript to call it..

  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    this why NextShow and TimeStamp are mandatory ;-)