Permalink
Browse files

Fixed README

  • Loading branch information...
1 parent c0e0118 commit bc875ea49bca9b8283e8a530076b73048d5e95bc Joe Stump committed Apr 29, 2009
Showing with 5 additions and 6 deletions.
  1. +5 −6 README.textile
View
@@ -57,20 +57,19 @@ var_dump($short);
h3. Extracting known URLs
-If you have a blob of text that may or may not contain short URLs in it, you can easily extract them with the <code>Services_ShortURL::extract() method. This method looks through the text for known short URLs, extracts them, expands them and then returns an array with a key/value pair of short/long URLs.
+If you have a blob of text that may or may not contain short URLs in it, you can easily extract them with the <code>Services_ShortURL::extract()</code> method. This method looks through the text for known short URLs, extracts them, expands them and then returns an array with a key/value pair of short/long URLs.
<pre>
<code>
<?php
-$url = 'http://tinyurl.com/jumvn';
+$txt = 'Hey check out http://tinyurl.com/jumvn and http://bit.ly/EojDf if you like politics.';
require_once 'Services/ShortURL.php';
-$api = Services_ShortURL::factory('TinyURL');
-$long = $api->expand($url);
+$urls = Services_ShortURL::extract($txt);
-// Should be http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html
-var_dump($short);
+// Will be a hash with short => long URls in it.
+print_r($urls);
?>
</code>

0 comments on commit bc875ea

Please sign in to comment.