It is currently May 2nd, 2024, 8:13 am

new skinner, need help with a basic webparser function

Get help with creating, editing & fixing problems with skins
Enzyme
Posts: 6
Joined: October 25th, 2012, 2:52 pm

new skinner, need help with a basic webparser function

Post by Enzyme »

hi all,

ive fiddled with skins before and now im attempting to create one from scratch.
it's function is to collect some lines of text form a websites chatbox.

some of the elements work great such as the chat text and date, but the username has a link in the middle which seems to break the function.

below is the lines of text in the page that contains the username, date and text (details replaced for privacy):

<a href='/site/user.php?id.00'>USERNAME</a> | <span class='cbdate'>14 Oct : 19:47</span></div></div>
<div class='smalltext'>
The chat text appears here
</div>

the section that is a link is:

/site/user.php?id.00

below is the line of code i am using to retrieve the username:

RegExp="(?siU)style='vertical-align: middle;' /> <a href='(.*)</a>"

and below the text displayed in rainmeter:

/site/user.php?id.00'>USERNAME

if i expand this to contain the full text (link included), i get a retrieval error and no text is shown.

this does not work:
RegExp="(?siU)style='vertical-align: middle;' /> <a href='/site/user.php?id.00'(.*)</a>"


as these usernames and links appear multiple times in the page and often change, i need this line to get my starting point.
' is too common :)

i have searched the tutorials and guides but i cannot figure out how to ignore that link and get the text displayed.

any help will be greatly appreciated, tearing my hair out over this. :x
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: new skinner, need help with a basic webparser function

Post by Kaelri »

If I understand correctly, you're just trying to get the username, right? What about:

Code: Select all

(?siU)style='vertical-align: middle;' /> <a href=.*>(.*)</a>
Or, if the links follow a specific pattern (e.g. they all start with "/site/user.php"):

Code: Select all

(?siU)style='vertical-align: middle;' /> <a href='/site/user.php.*'>(.*)</a>
Enzyme
Posts: 6
Joined: October 25th, 2012, 2:52 pm

Re: new skinner, need help with a basic webparser function

Post by Enzyme »

well that first line worked great. :D

i guess it was the placement of the "

kids home atm so concentrating is an issue, will compare later and see where i went wrong.


really glad you could help, thank you lots. :thumbup: