Changeset 1888
- Timestamp:
- 11/29/06 12:41:44
- Files:
-
- trunk/plagger (modified) (previous)
- trunk/plagger/lib/Plagger/Plugin/CustomFeed/YouTube.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/CustomFeed/YouTube.pm
r1775 r1888 68 68 m!<div class="vtitle">! 69 69 and $title_flag = 1; 70 m!<a href="/watch\?v=([^"]+)" >(.+)</a>!70 m!<a href="/watch\?v=([^"]+)"[^>]+>(.+)</a>! 71 71 and do { 72 72 if($title_flag){ … … 76 76 } 77 77 }; 78 m!<img src="(http://[\w-]*static\d+(.[\w-]+)?\.youtube.com/[^">]+/[12].jpg)" class="vimg120" />! 78 # get image url 79 m!<img src="(http://[\w-]*static\d+(.[\w-]+)?\.youtube.com/[^">]+/[12].jpg)" border="0" class="vimg120" />! 79 80 and $data->{image}->{url} = $1; 81 # get description 80 82 m!<div class="vdesc">! 81 and $data->{description} = <$fh>; 83 and do { 84 <$fh>; 85 $data->{description} = <$fh>; 86 }; 87 # get tags 82 88 m!<div class="vtagLabel">Tags:</div>! 83 89 and $tag_flag = 1; 84 m!(<a href="/results\?search_ type=.*)!90 m!(<a href="/results\?search_query=.*)! 85 91 and do { 86 92 if($tag_flag){ … … 89 95 } 90 96 }; 91 m!profile\?user=([^"]+)! 97 # get author 98 m!From:</span> <a href="/user/[^>]+">([^<]+)</a>! 99 and $data->{author} = $1; 100 m/<!-- end vEntry -->/ 92 101 and do { 93 102 $context->log( info => 'Got ' . $data->{title}); 94 $data->{author} = $1;95 103 my $entry = Plagger::Entry->new; 96 104 $entry->title($data->{title}); … … 106 114 107 115 # tags 108 while( $data->{tags} =~ /<a href="\/results\?search_ type=[^"]+" class="dg">([^<]+)<\/a>/gms){116 while( $data->{tags} =~ /<a href="\/results\?search_query=[^"]+" class="dg">([^<]+)<\/a>/gms){ 109 117 $entry->add_tag($1); 110 118 } … … 128 136 129 137 if ($video_url) { 138 warn $video_url; 130 139 my $video_id = ( $video_url =~ /video_id=(\w+)/ )[0]; 131 140
