Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100 off


PHP Tutorials and Scripts   




Title: Fetching a daily horoscope    Marked Cool    (Review this resource)
Author: CYBER_Aeon
Posted On: 2004-11-16
Category: Home > PHP Tutorials

Popularity: 1 points out of 10    

Description: Retrives a plain-text block of data from Astrology.com, run by iVillage.com - In this case, the data is a daily horoscope.

Total Hits: 923     Total Votes: 0     Total Points: 0 (0 reviews)        [ Download ]   

Page Navigation:  [1]


php:

// Please - If you use this code in your website,
// give credit to iVillage.com and Astrology.com
// - Its a small price to pay for such a nice service.
//
// Inputs
//
$Sign = "capricorn";

// -------------------
// Begin Code
// -------------------

$TargetURL = "http://horoscopes.astrology.com/daily" . $Sign . ".html";
$Data = implode('', file($TargetURL) );
$PntA = strpos( $Data, "<daily_horoscope>" ) + strlen("<daily_horoscope>");
$PntB = strpos( $Data, "</daily_horoscope>", $PntA );
$Data = substr( $Data, $PntA, $PntB - $PntA );
$Data = str_replace( "<a href='javascript:s2flink();' class=rao>Send this page to a friend.</a>", "", $Data );
$Data = htmlentities(htmlspecialchars($Data));
//
// Outputs
//

echo $Data;




Page Navigation:  [1]



© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.