xboxscene.org forums

Author Topic: Making A Script  (Read 261 times)

hhsweatherman

  • Archived User
  • Newbie
  • *
  • Posts: 14
Making A Script
« on: July 19, 2005, 10:58:00 AM »

I don't know much about how the XBMC scripts work, and I have never made one.  I was wondering though, if someone could make or tell me how to make a script for this Mac OS program.  I would really like this program on my XP computer,  but the download files look like some scripts.  So I was wondering if there is any way this Mac OS program could work on XBMC or my PC.  Thanks for any help.

"Gas" Program
Logged

MrFish

  • Archived User
  • Full Member
  • *
  • Posts: 182
Making A Script
« Reply #1 on: July 19, 2005, 11:46:00 AM »

QUOTE(hhsweatherman @ Jul 19 2005, 06:33 PM)
I don't know much about how the XBMC scripts work, and I have never made one.  I was wondering though, if someone could make or tell me how to make a script for this Mac OS program.  I would really like this program on my XP computer,  but the download files look like some scripts.  So I was wondering if there is any way this Mac OS program could work on XBMC or my PC.  Thanks for any help.

"Gas" Program
*


It's not impossible (and it would be a pretty easy third or fourth project). The Gas widget is written in JavaScript rather than python, so it would be as much effort to port it to XBMC as it would be to write it from scratch. Because it is in javascript, it's possible to look at all the code and see how it works. It also wouldn't be that difficult to port it from OSX to generic javascript, where it would be usable on any platform with a web browser. (That said, I'm not going to do it for you; it's not a useful program to me, there are copyright issues, and it's better you learn to fish for yourself).

If you want it in XBMC, you'll have to look at the code, understand how it works, and write your own version in Python. Have a look at http://members.cox.net/alexpoet/downloads/...Python-XBMC.pdf for an introduction to python scripting in XBMC, and the file js.js in the Gas widget to see how it does its thing (hint: it goes to http://www.gaspricewatch.com , submits a query to their zipcode search, scrapes out the result, and displays it in a pretty manner).

A possible route to learning to program:

Find some tutorials on Javascript programming, and write some simple Javascript
Find some tutorials on Python programming, and write some simple Python
Find some tutorials on programming XBMC python scripts, and write a simple script for XBMC
Take what you've learned, and use it to write your own useful XBMC script

Don't be scared of programming: if you can give directions, you can program. Lots of people think it's too difficult, but it really isn't.
Logged

jjjjlong

  • Archived User
  • Newbie
  • *
  • Posts: 29
Making A Script
« Reply #2 on: July 19, 2005, 11:57:00 AM »

QUOTE(hhsweatherman @ Jul 19 2005, 12:33 PM)
I don't know much about how the XBMC scripts work, and I have never made one.  I was wondering though, if someone could make or tell me how to make a script for this Mac OS program.  I would really like this program on my XP computer,  but the download files look like some scripts.  So I was wondering if there is any way this Mac OS program could work on XBMC or my PC.  Thanks for any help.

"Gas" Program
*




I'd learn Python scripting... I think thats what most of the scripts in XBMC is built off. Shouldnt be hard to port that widget over to python code.. Might try it myself on my mac :)

Cheers!
:beer:
Logged