aboutsummaryrefslogblamecommitdiffstats
path: root/library/.slinky.php.swp
blob: ab043e8806fcdcc3e94dc35ef9988148cde521bc (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
b0VIM 7.2�
`O��<�ftonydeathstar~tony/hax/webhax/friendika/friendica/library/slinky.php
3210#"! UtpY��������uZ��������}���������jL��������|����������2��������$�ad�Y�����p21��_�
�
8


�|4��H�
�
b
%
#
 

�	�	�	@	?	
	��wWVR���B>��5��NFB���������{ma840���<����TP��� *  * - echos out the long version of http://tinyurl.com/jw5sh (which should be http://dentedreality.com.au/) * echo $slinky->long(); * $slinky = new Slinky( 'http://tinyurl.com/jw5sh' ); *  * - echos the short version of http://dentedreality.com.au/ (default to TinyURL) * echo $slinky->short(); * $slinky = new Slinky( 'http://dentedreality.com.au/' ); *  * - Creates new Slinky, forces use of Bit.ly for ->short(); * $slinky = new Slinky( 'http://dentedreality.com.au', new Slinky_Bitly() ); *  * - Creates a new Slinky instance, will default to using TinyURL for ->short(); * $slinky = new Slinky( 'http://dentedreality.com.au/' ); *  * To use Slinky: *  *  * - Snipr / Snipurl / Snurl.com / Sn.im * - 2tu.us * - Tighturl * - Ptiturl * - ur1.ca * - Micurl.com * - Fon.gs * - Is.Gd * - TinyURL * - Tr.im * - Bit.ly * using these services: * Slinky supports shortening, and auto-detection (for lengthening URLs)  *  * URL. * DB or whatever to avoid having to hit APIs etc every time you encounter a * URLs. I'd strongly suggest that you cache results using memcached, a local * to set some configuration options before actually shortening/lengthening * for shortening URLs. If you want to use some of the other services, you need * adding your own relatively easily. It defaults to using TinyURL * It supports some of the more popular services, with easy extensibility for *  * Slinky will ONLY work with PHP5+ *  * extension installed if you're working with a service that uses JSON. * Slinky assumes you have cURL installed and working, and requires the JSON *  * using popular URL shortening services. * Slinky allows you to go back and forth between "long" and shortened URLs /**define( 'SLINKY_TIMEOUT', 10 );// How many seconds until remote requests should be cut?define( 'SLINKY_USER_AGENT', 'Slinky v1.0 +http://dentedreality.com.au/projects/slinky/' );// So that services may decide what to do with usdefine( 'SLINKY_FINAL_URL', 3 ); // Default for lengthening URLsdefine( 'SLINKY_HEADERS', 2 ); // Not implemented yetdefine( 'SLINKY_BODY', 1 ); // Default// Return options for Slinky_Service->url_get() and ->url_post()*/	SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND	ON(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGESDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FORWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND   prior written permission.   to endorse or promote products derived from this software without specific  - Neither the name of Dented Reality nor the names of the authors may be used    and/or other materials provided with the distribution.   this list of conditions and the following disclaimer in the documentation  - Redistributions in binary form must reproduce the above copyright notice,    list of conditions and the following disclaimer. - Redistributions of source code must retain the above copyright notice, this are permitted provided that the following conditions are met:Redistribution and use in source and binary forms, with or without modification,All rights reserved.Copyright (c) 2009, Beau Lebens/*<?phpadO
�
$���	�WTR3�
�
�

�������gI0����pTP�
�
// echo $slinky->short();// $slinky = new Slinky( 'http://dentedreality.com.au/' );// // - http://snipr.com/nbbw3// - http://tighturl.com/kgd// - http://ptiturl.com/?id=bac8fb// - http://ur1.ca/7dcd// - http://micurl.com/qen3uub// - http://fon.gs/tc1p8c// - http://is.gd/1yJ81// - http://tr.im/sk1H// - http://bit.ly/hEkAD// - http://tinyurl.com/jw5sh// If you're testing things out, http://dentedreality.com.au/ should convert to:}	}			return $url;		else			return $response;		if ( 'ERROR' != substr( $response, 0, 5 ) )		$response = $this->url_post( 'http://snipr.com/site/getsnip', array( 'sniplink' => urlencode( $url ), 'snipuser' => $this->get( 'user_id'), 'snipapi' => $this->get( 'API' ), 'snipformat' => 'simple' ) );					return $url;		if ( !$this->get( 'user_id' ) || !$this->get( 'API' ) )	function make_short( $url ) {		}		return !stristr( $url, 'snipr.com/' ) || !stristr( $url, 'snipurl.com/' ) || !stristr( $url, 'snurl.com/' ) || !stristr( $url, 'sn.im/' );	function url_is_long( $url ) {		}		return stristr( $url, 'snipr.com/' ) || stristr( $url, 'snipurl.com/' ) || stristr( $url, 'snurl.com/' ) || stristr( $url, 'sn.im/' );	function url_is_short( $url ) {	// Snipurl, Snurl, Snipr, Sn.imclass Slinky_Snipr extends Slinky_Service {