[help] how to "grab" information from a webpage and list it in xbmc..
#1
For example:

in youtube plugin - it shows the name of the uploaded video on the xbmc entry.

This case:

i wish to grab information from a .php file and put it in the xbmc entry.

at the moment i manually have entered "Channel 1" and i want it to automaticly grab a certain line from the sites code (.php) and put it inplace of "Channel 1"

The actual line of code i wish to grab in red:

<tr bgcolor="#CCCCCC">

<td class="smallhead">Channel 1 - 15:00 wales vs england</b></td>
</tr>
Reply
#2
You'll want to read up on regex or Regular Expression.
Reply
#3
Sranshaft Wrote:You'll want to read up on regex or Regular Expression.

thank you, having a look now - any examples of extracting a line of data via regex?

just checked the "examples" link but cannot find Confused
Reply
#4
ok im really struggling with grabbing information from any website at all and being able to put it in as a item in xbmc.

i have a list of channels which are all working "channel 1" channel 2 etc.

although im trying to rip some text from a php file.

"Channel 1" = channel1.php
"Channel 2" = channel2.php

all from a website on the internet (liveonlinefooty.com)

the first lines of code from this website is:

Quote:<head>
<meta http-equiv="refresh" content="25205">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LiveOnlineFooty.com</title>
<script src="../flash/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<link href="../css/style.css" rel="stylesheet" type="text/css" /></head>
<body>


<table width="100%" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#CCCCCC">

<td class="smallhead">Channel 1 - 15:00 wales vs england</b></td>
</tr>

the red highlight bit is what i wish to grab and then put elsewere - grabbing it is what is playing with my head Sad any suggestions?
Reply
#5
I know very little about formal programming but I have managed to cobble together a few scripts in the past using advice from people in IRC.

If you go into IRC on the freenode server there is a channel for every programming language. If you join the python one and as long as you demonstrate to people that you are trying and tell them exactly where you get stuck, they are usually very happy to help.

The principled of regular expression and matching text are really very simple, its just difficult to get all the syntax correct without spending all your time learning the whole language!
Reply
#6
This looks interesting,

Should be useful for the login of the website too

http://www.mayukhbose.com/python/IEC/index.php
Reply
#7
Here's a link to an example of pulling an URL from some HTML. It's not exactly what you're after but the basic concepts still apply, just substitute the URL for the string you're looking for.

You might also want to look into BeautifulSoup. I've noticed several add-on developers using that here and from the example at that link it looks to be a fair bit easier / cleaner too.
Reply

Logout Mark Read Team Forum Stats Members Help
[help] how to "grab" information from a webpage and list it in xbmc..0