Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2.  
  3. $content=file_get_contents('https://www.youtube.com/user/Fletcher2008/videos');
  4.  
  5. $content=preg_replace('/[s]+/',' ',$content);
  6. $content=preg_replace('/"/','',$content);
  7. $content=preg_replace('/href=/watch?v=/',"n",$content);
  8. $content=preg_replace('/<(span|img)[^>]*>/','',$content);
  9. $content=preg_replace('/</(span|img)>/','',$content);
  10. $content=preg_replace('/[s]*class=[^>^n]*>/','>',$content);
  11. $content=preg_replace('/>[s]*/','>',$content);
  12. $content=preg_replace('/[s]*</','<',$content);
  13. $content=preg_replace('/<button.*/','',$content);
  14. $content=preg_replace('/></a>/','','',$content);
  15. $content=preg_replace('/</a>.*/','',$content);
  16. $lines = preg_split('/n/', $content);
  17.  
  18. $count=0;
  19. foreach($lines as $line){
  20. if($count==0) {
  21. $count=1;
  22. } else if($count==1) {
  23. $sql.="('".$line."',";
  24. $count=2;
  25. } else if($count==2) {
  26. $line=preg_replace('/^[^>]*>/','',$line);
  27. $sql.="'".$line."'),n";
  28. $count=1;
  29. echo $line."<br>";
  30. }
  31. }
  32.  
  33.  
  34. ?>
  35.  
  36. <?php
  37.  
  38. $content=file_get_contents('https://www.youtube.com/user/Fletcher2008/videos');
  39.  
  40. if (preg_match_all('%<h3 class="yt-lockup-title"><a[^>]*href="([^"]+)"[^>]*>([^<]+)%iu', $content, $matches))
  41. {
  42. header('Content-type: text/html; charset=utf-8');
  43.  
  44. $count = count($matches[0]);
  45. $i = 0;
  46. for ($i = 0; $i < $count; $i++)
  47. {
  48. echo htmlspecialchars($matches[1][$i], ENT_QUOTES, 'UTF-8');
  49. echo ' --- ';
  50. echo htmlspecialchars($matches[2][$i], ENT_QUOTES, 'UTF-8');
  51. echo "<br>n";
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement