& Lt ;? Phpfunctionmy_headlines ($ url) {$ rdfparse_url ($ url); $ fpfsockopen ($ rdf [& amp; 39; host & amp; 39;], 80, $ errno, $ errstr, 15); if (! $ Fp) {$ content & quot; & lt;
- Function my_headlines ($ url ){
- $ Rdf = parse_url ($ url );
- $ Fp = fsockopen ($ rdf ['host'], 80, $ errno, $ errstr, 15 );
- If (! $ Fp ){
- $ Content = "content"> Problema! ";
- Return;
- }
- If ($ fp ){
- Fputs ($ fp, "GET". $ rdf ['path']. "? ". $ Rdf ['query']." HTTP/1.0 ");
- Fputs ($ fp, "HOST:". $ rdf ['host']. "");
- $ String = "";
- While (! Feof ($ fp )){
- $ Pagetext = fgets ($ fp, 300 );
- $ String. = chop ($ pagetext );
- }
- Fputs ($ fp, "Connection: close ");
- Fclose ($ fp );
- $ Items = explode ("", $ String );
- $ Content = "content"> ";
- For ($ I = 0; $ I <10; $ I ++ ){
- $ Link = ereg_replace (".* "," ", $ Items [$ I]);
- $ Link = ereg_replace (". * "," ", $ Link );
- $ Title2 = ereg_replace (".*"," ", $ Items [$ I]); </li> <li class =" alt "> $ title2 = ereg_replace (". * "," ", $ Title2 );
- If ($ items [$ I] = ""){
- $ Content = "";
- Return;
- } Else {
- If (strcmp ($ link, $ title )){
- $ Cont = 1;
- $ Content. = "images/arrow.gif" border = "0" hspace = "5"> $ link "target =" new "> $ title2
";
- }
- }
- }
- }
- Echo "$ content ";
- }
- My_headlines
- ?>