Bug - Fixed Meme generator permalink references mafia folder instead of KoL's butt

Permalink from a meme generated in vanilla KoL:

Permalink from a Mafia-generated meme:
/images/memes/2090562_1471480811.html

I checked, and appending that to the KoL cloud URL does show the meme, so it got saved properly.
e: The meme also got saved into my Mafia folder (so appending the relay browser URL also works) but I'm inclined to think that part is a bug on KoL's end, if it's a bug at all.
 
Last edited:
RelayAgent.java:

Code:
			if ( Preferences.getBoolean( "useImageCache" ) )
			{
				StringBuffer responseBuffer = new StringBuffer( this.request.responseText );

				// Load image files locally to reduce bandwidth
				StringUtilities.globalStringReplace( responseBuffer, KoLmafia.AMAZON_IMAGE_SERVER, "/images" );
				StringUtilities.globalStringReplace( responseBuffer, KoLmafia.KOL_IMAGE_SERVER, "/images" );
				StringUtilities.globalStringReplace( responseBuffer, "//images.kingdomofloathing.com", "/images" );

				// Download and link to any Players of Loathing picture pages locally.
				StringUtilities.globalStringReplace( responseBuffer, "http://pics.communityofloathing.com/albums", "/images" );

				this.request.responseText = responseBuffer.toString();
			}
That is zealous.

Seems like rather than having three calls to StringUtilities.globalStringReplace, we could have a single Matcher find/replace loop which would find all three paths and allow us to look at each match and decide whether or not to replace it.
 
Revision 17317 fixes this.

I also noticed:

https://www.kingdomofloathing.com/iii/otherimages/memeages/meme17.png

Looks like KoL has Yet Another Place to store images.
 
Back
Top