It is currently April 23rd, 2024, 6:53 pm

Problem with WebParser: RegExp matching error (-1)

Get help with creating, editing & fixing problems with skins
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Problem with WebParser: RegExp matching error (-1)

Post by FreeRaider »

Can you post that URL and the regular expression?
User avatar
Droyk
Posts: 56
Joined: July 9th, 2015, 7:40 am

Re: Problem with WebParser: RegExp matching error (-1)

Post by Droyk »

FreeRaider wrote:Can you post that URL and the regular expression?
Here is the url

Code: Select all

https://kat.cr/games/?rss=1
and

Code: Select all

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url=%22https://kat.cr/games/?rss=1%22
this is what i use to get rss from the above url

and this is my REGEXP that was working until today
LONG Version

Code: Select all

(?siU)<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>

Short version

Code: Select all

(?siU)<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Problem with WebParser: RegExp matching error (-1)

Post by FreeRaider »

I think that YQL has a connection timeout of 5 seconds, in fact if I test your link, I get this:
{
"query": {
"count": 0,
"created": "2015-09-13T11:34:30Z",
"lang": "en-US",
"diagnostics": {
"publiclyCallable": "true",
"url": {
"error": "Connect Failure",
"execution-start-time": "1",
"execution-stop-time": "5324",
"execution-time": "5323",
"content": "https://kat.cr/games/?rss=1"
},
"user-time": "5325",
"service-time": "5323",
"build-version": "0.2.509"
},
"results": null
}
}
User avatar
Droyk
Posts: 56
Joined: July 9th, 2015, 7:40 am

Re: Problem with WebParser: RegExp matching error (-1)

Post by Droyk »

So What should i do ?
Is there is any solution to this
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Problem with WebParser: RegExp matching error (-1)

Post by FreeRaider »

I'm sorry, I have not a solution.
User avatar
Droyk
Posts: 56
Joined: July 9th, 2015, 7:40 am

Re: Problem with WebParser: RegExp matching error (-1)

Post by Droyk »

FreeRaider wrote:I'm sorry, I have not a solution.
The solution could be quite simple you know we just have find another API
i find one
http://api.duckduckgo.com/?q=DuckDuckGo&format=json&pretty=1

but i don't know how to make this api work like yahoo api
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Problem with WebParser: RegExp matching error (-1)

Post by eclectic-tech »

Droyk wrote:So What should i do ?
Is there is any solution to this
I believe you are fighting an unwinnable battle with this webmaster.

Even if a solution is found (I can't find one for you), it appears the webmaster wants the site accessed via a recognizable browser or feed reader. So, if you do find another way to get the info into your skin, the site will be modified again, in the near future, to prevent this.

In the last 3 months:
1) The site changed to prevent webparser from accessing the info
2) You modified your code to use Yahoo's query language and got it working
3) Now the website changed again and is preventing access using the Yahoo query
4) You can access the feed with a browser, but not with any non-browser/feed reader method...

You are right back where you started 3 months ago!

I do not think there is a viable working solution, because the site is constantly changing, preventing all non-browser/feed reader access. This is an unwinnable battle I am not going to fight.

Good luck!

Edit: I see you posted an alternate, but I doubt it will work longer than a month before the website changes again.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Problem with WebParser: RegExp matching error (-1)

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Item=.*<item>.*<title>(.*)</title>.*<category>(.*)</category>.*<author>(.*)</author>.*<link>(.*)</link>.*<pubdate>(.*)</pubdate>.*</item>

[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=https://kat.cr/games/?rss=1
Download=1
DownloadFile=kat.xml
FinishAction=[!CommandMeasure MeasureFile "Update"]

[MeasureFile]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#DownloadFile\kat.xml
RegExp=(?siU)#Item##Item##Item##Item##Item#

[MeasureTitle1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFile]
StringIndex=1

[MeasureCategory1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFile]
StringIndex=2

[MeasureAuthor1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFile]
StringIndex=3

[MeasureLink1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFile]
StringIndex=4

[MeasurePubDate1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFile]
StringIndex=5

; and so on...

[MeterTitle1]
Meter=String
MeasureName=MeasureTitle1
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1

[MeterCategory1]
Meter=String
MeasureName=MeasureCategory1
Y=0R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1

[MeterAuthor1]
Meter=String
MeasureName=MeasureAuthor1
Y=0R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1

[MeterLink1]
Meter=String
MeasureName=MeasureLink1
Y=0R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1

[MeterPubDate1]
Meter=String
MeasureName=MeasurePubDate1
Y=0R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1

; and so on...
1.jpg
If you use Download=1 on a URL, instead of connecting to it and requesting that it return HTML to parse, (which this site will block in WebParser / RainRegExp) it will just treat the entire thing as a "file" and download it. This can often get around issues where a site is checking for a browser user-agent string in the request.

One you have the entire .html file saved locally, you can then parse it with WebParser using the file:// protocol instead of http://

I certainly can't promise that this site won't detect this activity and block it as well. Only time will tell.
You do not have the required permissions to view the files attached to this post.
User avatar
Droyk
Posts: 56
Joined: July 9th, 2015, 7:40 am

Re: Problem with WebParser: RegExp matching error (-1)

Post by Droyk »

eclectic-tech wrote: I believe you are fighting an unwinnable battle with this webmaster.

Even if a solution is found (I can't find one for you), it appears the webmaster wants the site accessed via a recognizable browser or feed reader. So, if you do find another way to get the info into your skin, the site will be modified again, in the near future, to prevent this.

In the last 3 months:
1) The site changed to prevent webparser from accessing the info
2) You modified your code to use Yahoo's query language and got it working
3) Now the website changed again and is preventing access using the Yahoo query
4) You can access the feed with a browser, but not with any non-browser/feed reader method...

You are right back where you started 3 months ago!

I do not think there is a viable working solution, because the site is constantly changing, preventing all non-browser/feed reader access. This is an unwinnable battle I am not going to fight.

Good luck!

Edit: I see you posted an alternate, but I doubt it will work longer than a month before the website changes again.
I think you got it right i should forget about this
but i will still try i know this is just a stupid thing to do
but u should think like this not everything is perfect
no matter how much he tries he cant block everything
and u could say the same thing to me too No matter how much i tries i still cant get to everything
User avatar
Droyk
Posts: 56
Joined: July 9th, 2015, 7:40 am

Re: Problem with WebParser: RegExp matching error (-1)

Post by Droyk »

jsmorley wrote: If you use Download=1 on a URL, instead of connecting to it and requesting that it return HTML to parse, (which this site will block in WebParser / RainRegExp) it will just treat the entire thing as a "file" and download it. This can often get around issues where a site is checking for a browser user-agent string in the request.

One you have the entire .html file saved locally, you can then parse it with WebParser using the file:// protocol instead of http://

I certainly can't promise that this site won't detect this activity and block it as well. Only time will tell.
YUP only the time will tell

and
Thanxxx :thumbup: jsmorley i don't really know how do i thank U :rosegift:

i don't have anything to say right now
i could do just this for U :bow: :rosegift: