Guest User

Untitled

a guest
Jan 22nd, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. <?php
  2.  
  3. include('simple_html_dom.php');
  4. include("imdb.php");
  5.  
  6. $html = new simple_html_dom();
  7. $html->load_file($_GET['q']);
  8.  
  9.  
  10. require("IXR_Library.php");
  11. //////recplace domain.ro with your domain name ////////
  12. $client = new IXR_Client("http://www.putlockeris.org/xmlrpc.php");
  13. ///insert user and pass from wp-admin //
  14. $USER = 'kyle';
  15. $PASS = 'pass';
  16. ///end insert user and pass from wp-admin //
  17.  
  18. $ret = $html->find('div.mlink_imdb');
  19. foreach($ret as $elements) {
  20. foreach($elements->find('a') as $link) {
  21. $imdb = $link->href;
  22.  
  23. }
  24. }
  25.  
  26. $ret = $html->find('div.movie_thumb');
  27. foreach($ret as $img) {
  28. foreach($img->find('img') as $img_url) {
  29. $poster = $img_url->src;
  30.  
  31. }
  32. }
  33.  
  34. $theData = array();
  35. foreach($html->find('table tr') as $row) {
  36.  
  37. $rowData = array();
  38. foreach($row->find('td') as $cell) {
  39.  
  40. // push the cell's text to the array
  41. $rowData[] = $cell->plaintext;
  42. }
  43.  
  44. // push the row's data array to the 'big' array
  45. $theData[] = $rowData;
  46. }
  47.  
  48. foreach($theData[2] as $duration)
  49. foreach($theData[1] as $released)
  50. foreach($html->find('<td colspan="2"><p style="width:460px; display:block;">') as $description){
  51. $description = $description->plaintext;
  52. }
  53.  
  54. $meta_title = $html->find("meta[property='og:title']", 0)->content;
  55.  
  56. $imd=str_replace("http://www.imdb.com/title/","",$imdb);
  57. $pic=str_replace("//","http://",$poster);
  58.  
  59. $host = array();
  60. foreach($html->find('span.version_host') as $vhost) {
  61.  
  62. $host[] = $vhost->innertext;
  63. }
  64.  
  65.  
  66. $tilu = '';
  67. $strong = $html->find('h1.titles');
  68. foreach($strong as $el) {
  69. foreach($el->find('strong') as $strong_t) {
  70. $tilu .= $strong_t->plaintext;;
  71.  
  72. }
  73. }
  74. $genuri = array();
  75. foreach($html->find('span.movie_info_genres a') as $gen) {
  76. $genuri[] = $gen->plaintext;
  77. }
  78. $imdb = new Imdb();
  79. $movieArray = $imdb->getMovieInfo($imd);
  80. $chip = $movieArray['poster'];
  81. $release = $movieArray['release_date'];
  82. $runtime = $movieArray['runtime'];
  83. $rating = $movieArray['rating'];
  84. $year = $movieArray['year'];
  85. $country = implode(", ", $movieArray['country']);
  86. $stars = implode(", ", $movieArray['stars']);
  87. $director = implode(", ", $movieArray['directors']);
  88.  
  89. $link = array();
  90. foreach($html->find('div.choose_tabs div.actual_tab table.movie_version ') as $download){
  91. $link[] = $download->find('tr td span.movie_version_link a',0)->href;
  92.  
  93. }
  94. $url = '';
  95.  
  96. $moloz = '';
  97. $path = array();
  98. foreach($link as $lin){
  99. $parts = parse_url($lin);
  100. parse_str($parts['query'], $query);
  101. $urll = base64_decode($query['url']);
  102.  
  103. $url = parse_url($urll);
  104. $path[] = $url['path'];
  105. $host_lin = $url['host'];
  106. $host_link=str_replace("www.","",$host_lin);
  107. $path_link = $url['path'];
  108. $v1 = 'go.ad2up';
  109. $v2 = '.com/afu.php?id=223301';
  110. $moloz .= '<table width="100%" cellpadding="0" cellspacing="0" class="movie_version movie_version_alt"><tbody><tr><td align="center" width="40" valign="middle"><span class=quality_dvd></span></td><td align="left" valign="middle"><span class="movie_version_link"><a href="http://'.(isset($host_link) && !empty($host_link) ? $host_link : $v1).''.(isset($path_link) && !empty($path_link) ? $path_link : $v2).'" rel="nofollow" title="Version '.count($path).'" target="_blank">Version '.count($path).' - Direct Link</a></span></td><td align="center" width="115" valign="middle"><span class="version_host">'.(isset($host_link) && !empty($host_link) ? $host_link : $v1).'</span></td><td align="center" width="100" valign="middle"><div class="movie_ratings"><ul id="unit_ul1894478038" class="unit-rating" style="width:100px;"> <a href="http://'.(isset($host_link) && !empty($host_link) ? $host_link : $v1).''.(isset($path_link) && !empty($path_link) ? $path_link : $v2).'" rel="nofollow" title="Version '.count($path).'" target="_blank"><img src="/play_video.gif" alt="stele" ></a> </ul></div></td></tr></tbody></table>';
  111.  
  112. }
  113. $content['title'] = $meta_title.$tilu;
  114. $content['description'] = $description;
  115.  
  116. $content['custom_fields'] = array(
  117. array('key' => 'poster','value'=>$pic),
  118. array('key' => 'run','value'=>''.$runtime.' min'),
  119. array('key' => 'released','value'=>$release),
  120. array('key' => 'actors','value'=>$stars),
  121. array('key' => 'directors','value'=>$director),
  122. array('key' => 'country','value'=>$country),
  123. array('key' => 'rating','value'=>$rating),
  124. array('key' => 'year','value'=>$year),
  125. array('key' => 'poza','value'=>$chip),
  126. array('key' => 'url','value'=>$moloz)
  127. );
  128.  
  129.  
  130.  
  131. if (!$client->query('metaWeblog.newPost','', $USER,$PASS, $content, true))
  132.  
  133. {
  134.  
  135. die( 'Error while creating a new post' . $client->getErrorCode() ." : ". $client->getErrorMessage());
  136.  
  137. }
  138. $ID = $client->getResponse();
  139.  
  140. if($ID)
  141. {
  142. echo 'Post published with ID:#'.$ID;
  143. }
  144.  
  145. ?>
Add Comment
Please, Sign In to add comment