Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   I need Help with some javascript code (https://www.warriorforum.com/programming/1016122-i-need-help-some-javascript-code.html)

tarunap 17th November 2014 07:41 AM

I need Help with some javascript code
 
Hi, I managed to get a video url from other page but I need to load that video with jwplayer.
Here is where I got.

CODE:
<html>
<head>
</head>
<body>
<?php
include ('functions.php');
$scraped_page = curl("http://somepage.com");
$scraped_data = scrape_between($scraped_page, "eval", "</script>");
echo '<div id="packed" style="visibility:hidden;">';
echo 'eval'.$scraped_data;
echo '</div>';
?>
<script language="javascript" type="text/javascript">
var coded = document.getElementById('packed').innerHTML;
var code;
eval("var value=String" + coded.slice(4));
code = value;
var vidurl = code.substr(156,90);
var imgurl = code.substr(270,51);
</script>
</body>
</html>

I need to pass to jwplayer the vidurl as the video and imgurl as thumbnail

Mrmoon75 17th November 2014 09:35 AM

Re: I need Help with some javascript code
 
Did you fix it already?

If not send me an pm. with the page and the links to the video and image.

premiumwebtechnologies 18th November 2014 01:14 PM

Re: I need Help with some javascript code
 
You shouldn't be doing it this way. Avoid "eval" wherever you can.

briannn 28th November 2014 03:24 AM

Re: I need Help with some javascript code
 
You should try this class"PHP Simple HTML DOM Parser".
You can download it from here: PHP Simple HTML DOM Parser

azhar 29th November 2014 02:17 AM

Re: I need Help with some javascript code
 
Hi,

I can help you. Please contact me if you still need some help.
Thanks


All times are GMT -6. The time now is 07:43 AM.