PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Khurram Adeeb Noorani  >  Perfect URL Trimmer  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example script
Class: Perfect URL Trimmer
Retrieve the shortest URL from several services
Author: By
Last change:
Date: 5 years ago
Size: 1,963 bytes
 

Contents

Class file image Download
<?php
/************************************************
* ======================================== *
* Perfect URL Trimmer *
* ======================================== *
* Script Name: index.php *
* Developed By: Khurram Adeeb Noorani *
* Email: khurramnoorani@gmail.com *
* My CV: http://www.visualcv.com/kanoorani *
* Twitter: http://www.twitter.com/kanoorani *
* Date Created: 05-AUGUST-2009 *
* Last Modified: 05-AUGUST-2009 *
************************************************/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Perfect URL Trimmer</title>
</head>
<body>
<h1>Perfect URL Trimmer</h1>
<?php
include("class.trimmer.php");
$TRIMMER=new TRIMMER();
/*
Optional parameters are tr.im bit.ly ur.ly for forcefully using a specific URL trimming services
See the comments on line #109 of class.trimmer.php
*/
?>
<h2>Trimming the URLs inside a string</h2>
<?php
$str
="The number one search engine is http://www.google.com but people also use www.yahoo.com as their second choice.";
echo
$str."<br>";
echo
$TRIMMER->trim_string($str);
?>
<h2>Trimming a URL using tr.im</h2>
<?php
$TRIMMER
->set_service("tr.im");
$url="http://www.facebook.com";
echo
$url."<br>";
echo
$TRIMMER->trim_url($url);
?>
<h2>Trimming a URL using bit.ly</h2>
<?php
$TRIMMER
->set_service("bit.ly");
$url="http://www.twitter.com";
echo
$url."<br>";
echo
$TRIMMER->trim_url($url);
?>
<h2>Trimming a URL using ur.ly</h2>
<?php
$TRIMMER
->set_service("ur.ly");
$url="http://www.twitterface.com";
echo
$url."<br>";
echo
$TRIMMER->trim_url($url);
?>
<h2>Trimming a URL that is already trimmed</h2>
<?php
$url
="http://bit.ly/164PhJ";
echo
$url."<br>";
echo
$TRIMMER->trim_url($url);
?>
</body>
</html>