Changeset 140056
- Timestamp:
- 07/28/2009 08:20:20 AM (17 years ago)
- File:
-
- 1 edited
-
draugiemsay/trunk/draugiemsay_wp.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
draugiemsay/trunk/draugiemsay_wp.php
r140047 r140056 26 26 27 27 function 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 } 29 40 if ( $shrink === FALSE ) { 30 41 $shrink = getfilefromurl( "http://cli.gs/api/v1/cligs/create?t=gffu&appid=WP-to-Twitter&url=".$thispostlink."&title=".$thisposttitle."&key=".$cligsapi); … … 32 43 if ( stristr( $shrink, "http://" ) === FALSE ) { 33 44 $shrink = FALSE; 34 }45 } 35 46 if ( $shrink === FALSE) { 36 update_option('wp_cligs_failure','1');37 $shrink = $thispostlink;47 update_option('wp_cligs_failure','1'); 48 $shrink = $thispostlink; 38 49 } 39 50 return $shrink; … … 63 74 } 64 75 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 : ''); 66 77 $xml = file_get_contents($xmllink); 67 78 $xmldata = simplexml_load_string($xml);
Note: See TracChangeset
for help on using the changeset viewer.