Page 1 of 1

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

Posted: 2005-09-04 19:18:37
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!
  ...
  ...
  ...

Posted: 2005-09-04 19:46:43
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.

Posted: 2005-09-04 21:42:02
by jcjimenez
that means I can't resolve it?

Regards,
Juan Carlos Jiménez

Posted: 2005-09-05 07:18:57
by antp
That means that you do not have to use UrlEncode there :p

Posted: 2005-09-05 12:00:40
by jcjimenez
Sorry! My english it's not very good :(

I've tested with GetPage(Address) and the same result. :cry:

Posted: 2005-09-05 12:41:50
by antp
getpage('http://info.frozen-layer.net/?a=showinf ... a0ec3ba4f8');
works, so be sure that Address variable contains the good value

Posted: 2005-09-06 21:02:57
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

Posted: 2005-09-06 21:16:19
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 :/