BossHuso / discord-rare-drop-notificater

Sends a detailed notification via Discord webhooks whenever you get a rare/unique drop.
BSD 2-Clause "Simplified" License
17 stars 41 forks source link

Change getIconUrl to get s.r.n. URL instead of wiki #69

Closed leejt closed 2 years ago

leejt commented 2 years ago

getIconUrl() used Special:Lookup on the wiki to do some kinda hacky stuff to convert an item ID into an icon url. This is a bit more complicated and brittle than it needs to be, because RuneLite actually hosts a full set of item icons, indexed by item ID, e.g. https://static.runelite.net/cache/item/icon/9593.png

Screenshot showing it still works with the new icon URLs:

image

I'm making this change because the wiki is going to start blocking okhttp default user-agents to combat overzealous scrapers. This isn't one of them, but it's using the default UA and it seemed like an easy enough opportunity to simplify it all so it doesn't even need to touch the wiki.