Commit 3c7117e4 authored by Aaron J. Seigo's avatar Aaron J. Seigo

simple url fetcher

parent e7c1d426
function fetchUrl(url, callback)
{
print("fetching " + url)
var job = plasmoid.getUrl(url)
var output = new String
function recv(job, data) {
if (data.length) {
output += (data.toUtf8())
}
}
function fini(job) {
//print("ifini!!" + job.output + job.callback)
if (callback) {
callback(output)
}
}
if (job) {
job.data.connect(recv)
job.finished.connect(fini)
}
}
UrlFetcher = function()
{
this.fetch = fetchUrl
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment