Error with GetPage, I can't resolve it :(

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
jcjimenez
Posts: 4
Joined: 2005-09-04 18:58:49

Error with GetPage, I can't resolve it :(

Post by jcjimenez »

Hi,
I'm making an Spanish Anime script getting the info from http://info.frozen-layer.net.

When you search a title in the Search form of the web, it shows the results if more than a hit is found (and I'm able to capture the list of results and urls). But if there is only one hit, the php directly forwards to the movie info page.

If I search Marmalade with the query:
http://info.frozen-layer.net/index.php? ... =marmalade
I get 2 results (no problem if I get 2 or more results)

But If I search Hayate with the query:
http://info.frozen-layer.net/index.php? ... ulo=hayate
It would give just 1 result so instead of that I directly get the info page:
http://info.frozen-layer.net/?a=showinf ... a0ec3ba4f8

The GetPage(Address) with an address that causes just one hit (like the 'hayate' one before) shows Socket Error #11004 and the Importing Data Window in Ant Movie Catalog says: "...frozen-layer.net?a=showinfoanime_id=554ttl=0ac413..." (the ... means no space in the window to see more). It's like there were no / and & symbols and the error appears! :(

Any help?

Code: Select all

procedure AnalyzeResultsPage(Address: string);
var
  PageText: string;
  Value: string;
begin
  PageText := GetPage(UrlEncode(Address)); <--- The line that causes the error!
  ...
  ...
  ...
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

You can't make an URLEncode on an full address. The URLEncode is for converting spaces and special characters to %nn characters. But the "/", "&", etc. that are in the URL should not fall in this function.
jcjimenez
Posts: 4
Joined: 2005-09-04 18:58:49

Post by jcjimenez »

that means I can't resolve it?

Regards,
Juan Carlos Jiménez
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

That means that you do not have to use UrlEncode there :p
jcjimenez
Posts: 4
Joined: 2005-09-04 18:58:49

Post by jcjimenez »

Sorry! My english it's not very good :(

I've tested with GetPage(Address) and the same result. :cry:
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

getpage('http://info.frozen-layer.net/?a=showinf ... a0ec3ba4f8');
works, so be sure that Address variable contains the good value
jcjimenez
Posts: 4
Joined: 2005-09-04 18:58:49

Post by jcjimenez »

Yes, of course it does. The problem is when you search for a title that gives just 1 result (instead of giving a 1 hit page with the link to the film, it gives directly the web).

If you try with
GetPage('http://info.frozen-layer.net/index.php? ... ulo=hayate');

you'll see this error :S
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Actually it seems to be a bug in the site.
It redirects to
http://info.frozen-layer.net?a=showinfo ... a0ec3ba4f8
rather than
http://info.frozen-layer.net/?a=showinf ... a0ec3ba4f8
(missing "/" after the host name, so it takes the whole URL has host name)
Maybe it would be faster to contact the site to correct this bug rather than correcting it in AMC, especially because it is not in AMC code that the change would have to be made but in Indy libraries, and I prefer to not modify this kind of things :/
Post Reply