Online Javascript editor - return results
#1
I'm looking for a way to execute some javascript code and use the results, I have a site who is getting pretty crazy in protecting their links and seem to change their code daily

Here's a snip of what they look like now, I'm trying to get the final link that written out in the document.write()

Code:
var zigala = '%25%33%34';
zigala = '%25%33%37';
if (typeof (swidth) == 'undefined') {
    swidth = "600";
}
var bzxcb3 = unescape(zigala);

function fwaza(str) {
  if (!str) {return '';}
    var gambastr = '';
  for (i = str.length - 1; i >= 0; i--) {gambastr += str.charAt(i);}
    return gambastr;
}
var qakvca = 42 / unescape(bzxcb3);
var cqnrcvk = 'UdefVbxMWY4MDI1NzI2ODM6ZjU3NzVjNWQ1NjJlMGEzNWJmNzI2NzlkZTNiYjFkMjk';
if (typeof (sheight) == 'undefined') {
    sheight = "400";
}
var swwujg = 'xMWY4MDI1NzI2ODM6ZjU3NzVjNWQ1NjJlMGEzNWJmNzI2NzlkZTNiYjFkMjk_';
var mdamtsji = "/E";
var asdfadsf = "/x";
var mmsw = "atch";
cqnrcvk = 'MTBkNDEyMjk2YjgzOmQ2NjU2OTZlOmIyOWUwYzc2MWI4YjdmZTNlZjg0YjEzNTc0M2';
cqnrcvkj = cqnrcvk.substring(qakvca);
var obzeov = "2M0cTNzEjY0gjZlNTZmdjY4IWM2czYwUWOyImOlZTO2UjN2QmOzgjY2kjMyEDNkBTM";

document.write('<ifr' + 'ame width="' + swidth + '" height="' + sheight + '" scrolling="no" frameborder="0" allowtransparency="true" src="http://sawlive.tv/embed/watch' + '/' + cqnrcvk + mdamtsji + swwujg + '"></iframe>');

The variable names are dynamic, and they have changed this code many times, so scraping is no longer an option

So I'm looking for a way to execute this code and it doesn't appear that XBMC has any support for javascript such as PyQT so I started looking for online resources

There are quite a few good javascript editors online, I can paste this code in to sites such as jsbin and jsfiddle and get my results, but I'm struggling to find a way where I can make use of these sites via an addon.. has anyone attempted?

Better yet is there a similar site that has an api where I can send in code and fetch results? jsfiddle has an api but is limited to just basics
Reply
#2
I don't know about distribution in the official repos (since they require compilation from C) but there are python bridges for javascript runtimes. Try python-spidermonkey?
Reply
#3
I did look briefly into spidermonkey but I believe it also needed to be compiled (?) or at least some of it's dependencies did

edit - yep, installation requires a compile - http://code.google.com/p/python-spidermonkey/


I was hoping an online resource like jsbin.com could be a work around for executing javascripts, but not getting anywhere as yet
Reply
#4
I found this, https://github.com/chrisdickinson/python-javascript, but it's pretty broken. Couldn't get it to work with your example Javascript.

I think your only option would be to run your own JS API server.
Reply
#5
Simply a javascript engine isn't enough, you need to fully support the DOM and usually understand broken, differeing HTML and make them into the standard representation.

i.e. you essentially need an entire webengine.

You could take a look at phantomjs (which in the old version had python support). It does require qt etc.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#6
Well since we need that kind of support and assuming that it wouldn't be something XBMC would try to incorporate, I was hoping there would be an online resource of sorts that could do the work for us

Pass in the raw and return the results.. still trying to find a way to do this with jsbin.com
Reply
#7
This seems interesting:

https://github.com/makinacorpus/spynner

Quote:Spynner is a stateful programmatic web browser module for Python. It is based upon PyQT and WebKit. It supports Javascript, AJAX, and every other technology that !WebKit is able to handle (Flash, SVG, ...). Spynner takes advantage of JQuery. a powerful Javascript library that makes the interaction with pages and event simulation really easy.

Using Spynner you would able to simulate a web browser with no GUI (though a browsing window can be opened for debugging purposes), so it may be used to implement crawlers or acceptance testing tools.

Is getting anything such as this implemented into XBMC at all feasible?
Reply

Logout Mark Read Team Forum Stats Members Help
Online Javascript editor - return results0