View Full Version : Scripting
11-03-2008, 07:18 AM
The script on this http://forre.st/storage page is python(source at the bottom), but I dont know it and dont really have time to learn it right now. Is there a way to make a similar script but with html or php? I am pretty good with html and know some php.
Thanks for any help.
11-03-2008, 07:23 AM
The Python script is creating a nifty little image, which is nice for data encapsulation, but really uneccessary unless you're trying to protect your data.
11-03-2008, 07:33 AM
WOW 5 min response time! Thats awsome, I have never seen that before! The best part is that my question wasn't denied!
I just have one question, how can I automatically grab the prices from the site?
11-03-2008, 07:41 AM
Hm... you mean the prices listed under each image? Well assuming they don't have an API they're willing to let you use, then one sloppy way to do that is use PHP/ASP to grab the page's source code and parse through it's DOM.
If you need any help with that let me know.
11-03-2008, 07:43 PM
Hum, that sounds not to hard, Ill try it out and see how far I can get.
11-03-2008, 07:54 PM
Here's a quick php API for you:
$url = $_GET["url"] ? $_GET["url"] : null;
if ($url) include($url);
11-03-2008, 08:11 PM
Uh, Im sorry
Can you explain how it works?
11-03-2008, 08:44 PM
Open up a blank txt document and copy and paste that php snippet into it, save it as something like "get_src.php"
Upload that to your server (I have a temporary example for you: http://ebonyaura.com/get_src.php) and that can serve as your page source API.
get_src.php accepts a single input called url and outputs that URL's source code. For example, "http://ebonyaura.com/get_src.php?url=http://www.google.com" will display google's homepage.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
try // Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
// Internet Explorer
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
alert("Your browser does not support AJAX!");
var xml_http = getXMLHttp();
xml_http.onreadystatechange = function()
if (this.readyState == 4)
<input type="button" value="click me" onclick="getAnotherPage('http://www.google.com');" />
Of course you'll need to change ebonyaura.com to your domain, but here's a working example of the page I just typed up for you: http://ebonyaura.com/project.html
Altogether, this is essentially a fast workaround for the same-origin policy constraint on ajax.
11-03-2008, 09:16 PM
Hum, that does not want to work on my server. I replaced ebonyaura.com to my domain.
Ill check on something.
And I have a question why is the "<input type="button" value="click me" onclick="getAnotherPage('http://www.google.com');" />"
11-04-2008, 03:04 AM
The whole point of that JS function and PHP api is that you can input any url any where, regardless of same-origin security sandbox issues.
google.com is just an example
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.