View Single Post
  #23  
Old 24th April 2013, 23:42
Hairy Hairy is offline
HowtoForge Supporter
 
Join Date: Mar 2013
Location: USA
Posts: 57
Thanks: 6
Thanked 27 Times in 16 Posts
Default

Quote:
Originally Posted by electronixcraft View Post
Hi!
I think there is a bug in aps_crawler.inc.php.
In line 223:
preg_match_all("/\<a href=\"(.+)\/\" class=\"vendor\"/i", $vendor_page, $matches);
You take the href from the result page, which was http://appscatalog.com/all-app/. Something probably changed with listing, because that page returns the links as relative, so taking out the relative part of the url is not enough.

I made a fast dirty hack on my side, just modify the formatVendorCallback to return '/all-app/'.$array_item.'.atom?vendor='.$array_item.'&pageSi ze=100'; and it is almost ok.

But something still buggy, because the download of some packages simply fail with this error:
"[INTERFACE]: APS crawler: String could not be parsed as XML"
Maybe the package's atom feed is missing or something, but you can easily avoid that by check the returned page for xml validity, by adding this line

if (!simplexml_load_string($xml)) continue;

to the inner "for" loop where you fetch the packages. (Probably would be better to exception check with simpleXMLElement, but I didnt want to mess so much with that code, just want a working aps installer )

Now, I can list and install packages without an issue
Thank you for your reply. I will be trying this soon, but atm I am busy with work. If this solution works, I will be sending you a cash payment.

Thank you for actually addressing the issue, instead of saying things like you loaded a VMWare image of a completely different tutorial, and got that particular tutorial to work after changing and updating the code, or asking if I have cURL installed, which was answered in the very first message of this thread.
Reply With Quote