diff --git a/app/services/nc_mall.rb b/app/services/nc_mall.rb index b4168a1d..a0a77537 100644 --- a/app/services/nc_mall.rb +++ b/app/services/nc_mall.rb @@ -6,7 +6,7 @@ module NCMall # each request. (This library does that automatically!) INTERNET = Async::HTTP::Internet.instance - # Load the NC home page, and return its useful data. + # Load the NC Mall home page content area, and return its useful data. HOME_PAGE_URL = "https://ncmall.neopets.com/mall/ajax/home_page.phtml" def self.load_home_page load_page_by_url HOME_PAGE_URL @@ -20,6 +20,30 @@ module NCMall load_page_by_url CATEGORY_PAGE_URL_TEMPLATE.expand(type:, cat:) end + # Load the NC Mall root document HTML, and extract the list of links to + # other pages ("New", "Popular", etc.) + ROOT_DOCUMENT_URL = "https://ncmall.neopets.com/mall/shop.phtml" + PAGE_LINK_PATTERN = /load_items_pane\(['"](.+?)['"], ([0-9]+)\).+?>(.+?)