Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Nov 8, 2009, 18:54   #1
Kyle R
SitePoint Addict
 
Kyle R's Avatar
 
Join Date: Dec 2008
Location: Australia
Posts: 311
Grabbing information

I am doing it fine for another part of the source code, but this one I'm having difficulty with because of the ' marks in the code.

http://www.youtube.com/watch?v=GibLntdLiJA

View the source, I need to grab whatever is in:

Quote:
'VIDEO_TITLE': 'Dizzee Rascal - Dance Wiv Me',
So I need to grab Dizzee Rascal - Dance Wiv Me from this code..

PHP Code:

preg_match('!.*?\'VIDEO_TITLE\': \'(.*?)\'!', $page, $matches);
    
$title_text = $matches[1];
I'm doing it like this... it seems to work, is it ok doing it like that?
Kyle R is offline   Reply With Quote
Old Nov 8, 2009, 22:36   #2
frank1
SitePoint Wizard
 
frank1's Avatar
 
Join Date: Oct 2005
Posts: 1,009
seems ok as it grabs every thing followed by video_title:

any way i think many php classes are available for it...
when i wrote one...i used xml of the video...which is more standard....
frank1 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 12:59.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved