Plugin Directory

Changeset 140056


Ignore:
Timestamp:
07/28/2009 08:20:20 AM (17 years ago)
Author:
ingus.rukis
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • draugiemsay/trunk/draugiemsay_wp.php

    r140047 r140056  
    2626
    2727function dr_shorten_link( $thispostlink, $thisposttitle, $cligsapi ) {
    28     $shrink = @file_get_contents( "http://cli.gs/api/v1/cligs/create?t=fgc&appid=WP-to-Twitter&url=".$thispostlink."&title=".$thisposttitle."&key=".$cligsapi);
     28    if (!class_exists('Snoopy')){
     29        require_once('Snoopy.class.php');
     30    }
     31    $snoopy = new Snoopy;
     32
     33    // Generate and grab the clig using the Cli.gs API
     34    // cURL alternative contributed by Thor Erik (http://thorerik.net)
     35    if ( $snoopy->fetchtext( "http://cli.gs/api/v1/cligs/create?t=snoopy&appid=WP-to-Twitter&url=".$thispostlink."&title=".$thisposttitle."&key=".$cligsapi ) ) {
     36        $shrink = $snoopy->results;
     37    } else {
     38        $shrink = @file_get_contents( "http://cli.gs/api/v1/cligs/create?t=fgc&appid=WP-to-Twitter&url=".$thispostlink."&title=".$thisposttitle."&key=".$cligsapi);
     39    }
    2940    if ( $shrink === FALSE ) {
    3041        $shrink = getfilefromurl( "http://cli.gs/api/v1/cligs/create?t=gffu&appid=WP-to-Twitter&url=".$thispostlink."&title=".$thisposttitle."&key=".$cligsapi);
     
    3243    if ( stristr( $shrink, "http://" ) === FALSE ) {
    3344        $shrink = FALSE;
    34     }
     45        }
    3546    if ( $shrink === FALSE) {
    36         update_option('wp_cligs_failure','1');     
    37         $shrink = $thispostlink;
     47    update_option('wp_cligs_failure','1');     
     48    $shrink = $thispostlink;
    3849    }
    3950    return $shrink;
     
    6374        }
    6475       
    65         $xmllink = 'http://api.draugiem.lv/xml/index.php?app=ea0ca99e9e2f046c32524f1979be0b73&apikey=' . $apikey . '&action=say/post&text=' . urlencode($fulltext) . '&prefix=' . urlencode() . '&public=1' . (!empty($profile) ? '&uid=' . $uid . '&type=' . $type : '');
     76        $xmllink = 'http://api.draugiem.lv/xml/index.php?app=ea0ca99e9e2f046c32524f1979be0b73&apikey=' . $apikey . '&action=say/post&text=' . urlencode($fulltext) . '&prefix=' . urlencode(get_option('draugiemsay_pretext')) . '&public=1' . (!empty($profile) ? '&uid=' . $uid . '&type=' . $type : '');
    6677        $xml = file_get_contents($xmllink);
    6778        $xmldata = simplexml_load_string($xml);
Note: See TracChangeset for help on using the changeset viewer.