External URL to Text

not from this site...
User avatar
Sniper_E
Sniper_E
Posts: 31
Joined: Sat Apr 13, 2013 2:35 pm
Flag: United States of America

External URL to Text

Post by Sniper_E »

Short version by Martin
Open includes/functions_content.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select all
		case MAGIC_URL_FULL:
			$tag   = 'm';
			$text   = $short_url;
			$text = make_title_link($url, $text);
Add after
Tip: Add the following line(s) on a new blank line after the preceding line(s) of find.
Code: Select all
			$handle = @fopen($url, "r");
         if ($handle)
         {
            while (($line = fgets($handle, 4096)) !== false) 
            {
               if (feof($handle)) break;
               $match = preg_match('$(\<title\>)(.*)(\<\/title\>)$i', $line, $matches);
               if ($match and trim($matches[2] !== ''))
               {
                  $text = strip_tags($matches[2]);
                  break;
               }
            }
            fclose($handle);
         }

No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

User avatar
Terry
Registered User
Posts: 2
Joined: Wed Dec 03, 2014 4:02 pm
Flag: Bangladesh

Re: External URL to Text

Post by Terry »

Thanx :twisted: