ChrisDaniels
Well-Known Member
Yep, I put that in there because it was annoying me too lol
1. Very impressed with progress.
2. The Humax logo is the wrong one! compare it with the boot logo or the one on the front of the box, you'll see what I mean
3. I guess that (for instance) xbmc developed addons for the various OD channels is a completely different beast to this one. I have them all (inc. 4OD) on my raspbmc setup though I'm no expert. 4OD is a bit rubbish though as its mainly old stuff (perhaps this is the only stuff you can do on these machines).
var db = openDatabase("FavouriteApps", "1.0", "Favourite Apps", 200000);
function insertRecord(uri, name, img)
{
$.post('http://localhost/path/to/script.jim', { 'action': 'insert', 'uri': uri, 'name': name, 'img': img });
}
function showRecords()
{
$("#apps-favouritelist").html("<!-- Empty List -->");
$.getJSON('http://localhost/path/to/script.jim?action=fetch', function(data, status, xhr) {
//console.log("Status: %s", status);
//console.dir(data);
$.each(data, function() {... TBD ...});
});
}
#!/mod/bin/jimsh
package require cgi
package require sqlite3
source /mod/webif/lib/setup
httpheader "application/json"
set action [cgi_get action fetch]
set uri [cgi_get uri]
set name [cgi_get name]
set img [cgi_get img]
set id [cgi_get id]
set db [sqlite3.open /mod/etc/portal.db]
$db query {
create table if not exists favourites (
id integer primary key autoincrement,
uri text,
name text,
img text)
}
switch $action {
insert {
$db query {
insert into favourites(uri, name, img) values('%s','%s','%s')
} $uri $name $img
}
update {
$db query {
update favourites set uri = '%s', name = '%s', img = '%s'
where id = '%s'
} $uri $name $img $id
}
delete {
$db query { delete from favourites where id = '%s' } $id
}
fetch {
set flag 0
puts "["
foreach rec [$db query { select * from from favourites order by id }] {
if {$flag} { puts "," }
puts " {"
set iflag 0
while {[llength $rec] > 1} {
set rec [lassign $rec key val]
if {$iflag} { puts "," }
puts -nonewline "\"$key\":\"$val\""
set iflag 1
}
puts -nonewline "\n }"
set flag 1
}
puts "\n]"
}
}
$.getJSON('http://localhost/portal/jim/script.jim?action=fetch', function(data, status, xhr) {
[1383211354] [error] [client 127.0.0.1] GET /portal/jim/script.jim: spawn_process: execle(script.jim): No such file or directory
[1383211354] [error] [client 127.0.0.1] GET /portal/jim/script.jim: Error 500: Internal Server Error
[1383216906] [error] [client 127.0.0.1] GET /mod/webif/html/portal/jim/script.jim: Error 404: Not Found
[1383216916] [error] [client 127.0.0.1] POST /mod/webif/html/portal/jim/script.jim: Error 404: Not Found
Humax HDR-Fox T2 (humax) 1.03.06/2.19
humax# /mod/webif/html/portal/jim/script.jim
-/bin/sh: /mod/webif/html/portal/jim/script.jim: not found
humax# cd /mod/webif/html/portal/jim
humax# ls
script.jim
Windows/DOS line endings in the script file I'd imagine.
Try:
Code:humax# cd /mod/webif/html/portal/jim humax# cp script.jim script.jim~ humax# dos2unix < script.jim~ > script.jim humax# chmod 755 script.jim