It is currently May 6th, 2024, 12:33 am

image loading like flickr but for polycount

Get help with creating, editing & fixing problems with skins
matsman
Posts: 4
Joined: October 16th, 2011, 5:57 pm

image loading like flickr but for polycount

Post by matsman »

Hi experts... maybe you can help me solve some problems.

I came across rainmeter last week and have been playing around with the flickrshow skin (download the zip from here if you like :) ) tweaking the looks, the size, more or less rewritten the regexp (because it wasn't working as well for me) and I added the name of the uploader which also links to that account, which is nice if you like a picture and want to see the rest that person has uploaded.

So that is nice and all, but now for the next level. Not images from flickr but from my trusty polycount.org... that means I don't have to open the browser and hit anymore to stay updated.

Now for my problem: Using rainregexp i wrote an expression that goes through the latest post search page on polycount and returns
1 the url of the latest post in the "what are you working on" thread
2 the time of the post
3 the poster

in rainregexp everything goes fine... however, rainmeter doesn't think so and says: "WebParser: [MeasureLink] Matching error! (-1)" anyway heres the code:

Code: Select all

[MeasureLink]
Measure=Plugin
UpdateRate=1000
Plugin=Plugins\WebParser.dll
Url=http://www.polycount.com/forum/search.php?searchid=1810704
Debug=1
RegExp="(?siU)What Are You Working On\? 2011 Edition!.*<a href="showthread\.php\?t=79625&page=3">3.*END TEMPLATE: threadbit_pagelink --> \.\.\. <a href="(.*)">Last Page</a>\)</span>.*Today <span class="time">(.*)</span>.*by <a href=".*" rel="nofollow">(.*)</a>  <a href=".*"><img class="inlineimg" src=".*" alt="Go to last post" border="0" /></a>"
so either I made a mistake here, or possibly I cannot acces the site from rainmeter (hope not!)

here is it working in rainregexp:
Image

and if you look closely at that screenshot I have another problem... the url is only half of the url needed because of php.
So I need to add the front half manually.... can that be done in the ini or do I have to add a lua script? It feels a bit much to add a script for just adding two strings together...

Anyway... that is my evening project written up. I hope you will be able to help me on my quest. The final product will be released here and on polycount once I get it finished, naturally.

Thanks for your interest and help.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: image loading like flickr but for polycount

Post by jsmorley »

That URL is taking me (and WebParser) to a login page, which WebParser can't deal with. It has no support for cookies or any other authentication, so it can only be used on sites that don't require a login, or where you can put the id and password on the URL like http://YourName:YourPW@somesite.com.
matsman
Posts: 4
Joined: October 16th, 2011, 5:57 pm

Re: image loading like flickr but for polycount

Post by matsman »

okay great thanks!

So now I know what is wrong... is there anyway I can test how to get my data...

For example... knowing this I set IE to completely block all cookies... and indeed I got the loginscreen... however when following the latest post link on that login screen I did got my search page again... this time with a different Url (http://www.polycount.com/forum/search.php?s=0479b0da690d28d0648afb9f157a0c38&searchid=1813207)
So that one works without cookies... still nothing in webparser because of this security probably.

Is there any sure way of finding out if a certain source of information can be used or not?

Excuse me for my newness to all this, just not ready to give up just yet :)

Also that means that Rainregexp is based upon a browser base and does support authentication and or cookies? I was under the impression it was meant to emulate the rainmeter web parser, with a little added insight info the creation of regexp.

Thanks again!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: image loading like flickr but for polycount

Post by jsmorley »

Both WebParser and RainRegExp use a "stub" of IE to connection to a website. What this means is that if you have an "active" cookie in IE for a site, it can connect to it. Not much use though, as cookies only stay active for some period of time, depending on the way the site has things set up. Once the cookie expires, neither WebParser or RainRegExp is going to be able to connect to the site.

If you have found a way to get to a page with the info you want that doesn't require that you be logged on, then there should be no problem parsing it with regular expressions.
matsman
Posts: 4
Joined: October 16th, 2011, 5:57 pm

Re: image loading like flickr but for polycount

Post by matsman »

Okay...a little update...

Tried something else...
this parse:

Code: Select all

RegExp="(?siU)What Are You Working On\? 2011 Edition!.*3</a>.*<a href="(.*)">Last Page</a>"
on this url:
http://www.polycount.com/forum/forumdisplay.php?f=42
gives me this find:
showthread.php?s=23619aa86c477736f8b7baef3ef3bfd2&t=79625&page=393

which is all nice and dandy (here we are with the half urls again!)

however
this parse:

Code: Select all

RegExp="(?siU)What Are You Working On\? 2011 Edition!.*3</a>.*<a href="(.*)">Last Page</a>.*Today <span class="time">(.*)</span><br />.*by <a href=".*" rel="nofollow">(.*)</a>  <a href="(.*)"><img class=".*" alt="Go to last post" border="0" /></a>"
gives me matching error -8
and not the expected finds of
same url as above+ time+ user + latest post

So what am I doing wrong this time?

On another note... using the first working parse I got some basic functionality. I can get the last page in the thread and read out some of the data posted... but I have to cheat a bit.

Code: Select all

[MeasureLast]
Measure=Plugin
UpdateRate=1000
Plugin=Plugins\WebParser.dll
Url=#WEB#
Debug=1
RegExp="(?siU)What Are You Working On\? 2011 Edition!.*3</a>.*<a href="(.*)s=.*&(.*)">Last Page</a>"
;RegExp="(?siU)What Are You Working On\? 2011 Edition!.*3</a>.*<a href="(.*)">Last Page</a>.*Today <span class="time">(.*)</span><br />.*by <a href=".*" rel="nofollow">(.*)</a>  <a href="(.*)"><img class=".*" alt="Go to last post" border="0" /></a>"
DecodeCharacterReference=1

[MeasureLink1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureLast]
StringIndex=1

[MeasureLink2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureLast]
StringIndex=2

[MeterMainTitleText]
Meter=String
MeterStyle=MeterStyle_1
MeasureName=MeasureName
FontSize=13
StringAlign=CENTER
W=250
H=20
X=120
Y=220
Text="%1"
LeftMouseDownAction=!Execute ["http://www.polycount.com/forum/[MeasureLink1][MeasureLink2]"]
As you can see I ommit a security in the Url by splitting it in two parts... which I use together with a manual part to get the full url... which allows me to link to the last page in the thread from rainmeter (see the final !execute)
But this type of syntax doesn't seem to work as a way to direct the parser to the correct url

Problems:
Possibly getting more data from the first parse (would make things easier)
Constructing a full url from 3 parts
Possibly show last result of a parse instead of first... but how to know the last?

So that is where it is now... I am off to bed.

Thanks!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: image loading like flickr but for polycount

Post by jsmorley »

http://rainmeter.net/cms/Tips-WebParserImageRelative

That article references "images", but the same approach would hold true for any partial URL retrieved by a WebParser measure.
matsman
Posts: 4
Joined: October 16th, 2011, 5:57 pm

Re: image loading like flickr but for polycount

Post by matsman »

OKay so that is what I was using... but that didn't work... probably something else is going on then... will try to find that out later...

In the mean time I've used a different link (gotten by rainregexp on the large but faulty expression) to find the image link.

So possibly it is a security issue again and the second link has less problems?
So I'd like to ask a little explanantion on the matching error 8. Specifically the large parse which did fine in Rainregexp but brought up the matching error in Rainmeter.

Is it just too complex or could it be something else entirely? to me it just says error 8 which is different then error 1, but both are noninformal as to find a solution.

Thank you very much, I am enjoying myself immensely with this puzzle project.