Wednesday, May 29, 2019

Changelog 2019-05-29 - Two Fixes

Swap Bot no longer references u/FreddySwapBot in its comments

The bot would occasionally use its own username as an example in comments. However, now that multiple subs are using this bot, that no longer makes sense so references to it have been removed.

Swap Bot now does a hard check for actual messages

Previously, the bot would assume anything that is not a username mention was a private message. This is not the case. So comment replies were getting counted as messages and going through the workflow of determining feedback for a user. This created a feedback loop with two bots both telling each other that a specific user had no feedback. This change prevents anything like that from happening.

Friday, May 24, 2019

Changelog 2019-05-24 - Two Fixes

Changed text on stickied comments for reddit in-stock posts

The original text was too wordy. Reduced it to just "Click here to get in-stock alerts sent to your phone." The text is a hyperlink which redirects to the stickied post on r/RegExr's reddit profile.

Changed swap bot to NOT ignore un-refreshable comments

Comments need to be "refreshed" before they can be viewed when using the Reddit API. Sometimes a comment cannot be refreshed. This was originally thought to be an issue that could alert us to comments being deleted, but it is actually more of a transient issue. Because of this, comments were being dropped due to an API failure and not for any valid reason. Fixed the swap bot so it still tracks comments that could not be refreshed.

Thursday, May 23, 2019

Changelog 2019-05-23 - One Fix

@FunkoWalgreens is back online

The twitter bot @FunkoWalgreens has been offline for some time as it was unreliable. A change to the way the HTML is scraped allowed for all products to reliably be captured on each run. The bot will once again work as intended.

Issues revolved around the bot trying to scrape the page as a spoofed browser due to limitations o f a normal get request. However, adding appropriate headers to the get request allows for the entire page the be returned. Using browser spoofing was ineffective because the site would lazy-load, causing us to only pick up about half the items on each execution.

Tuesday, May 21, 2019

Changelog 2019-05-21 - One Fix

@PopCommunity will now consistently tweet out a preorder thread link if applicable

There was an issue where the preorder link urls were not getting passed through if the blog scraper was unable to find images on a blog post. Now, regardless of if it can find images or not, a preorder thread url will be returned (assuming one was made) and sent out to be tweeted by @PopCommunity.

Thursday, May 16, 2019

Changelog 2019-05-16 - Three Fixes


Swap Bot - Now ignores people who tag themselves in favor of other people they tag

Sometimes, when people try to invoke the swap bot on r/funkoswap, they will tag themselves, their trade partner, and the bot rather than just their trade partner and the bot. The bot had some logic to handle ignoring people who tagged themselves and just look for tags of other people, but it had a logic error involving letter casing. A short fix to make everything work in lower case ensures this works properly.

Swap Bot - Now handles exceptions in iterating over inbox messages

The bot would, on occasion, crash during execution when iterating over messages in the inbox. This would cause any message read and marked as read to be lost. By moving the logic of marking a message as read to happen once all messages have been seen in the inbox, we can avoid marking a message as read but not acting on it. This is an extreme edge case that only presents itself on occasion but would cause the bot to miss some tags.

Swap Bot - Correctly determines is one of the commenters is the OP of the post in question

We always want to ensure that at one of the people involved in a confirmation is the original poster for that thread. Previously, this was done by checking the submitter of the parent of the comment the bot was tagged in. This assumed either a top level comment was made or someone replied to a previous discussion. However, there was a case where someone replied to AutoMod instead. Considering AutoMod was not one of the people involved in the trade, this check failed.

Now, we use the .is_submitter field on both comments in question (the tag and the confirmation) to ensure that one of them was made by the submitter of the post.

Wednesday, May 15, 2019

Changelog 2019-05-15 - One Fix

Blog Scraper will no longer post smaller resolution images to reddit

When a Funko blog post only contains one image, that image is directly linked to reddit rather than creating a compilation image, uploading it to imgur, and linking the imgur url to reddit. Some of these images contain "_large" in their urls. Shopify automatically appends this label to images in their CDN, along with "_small", "_medium", and no label. No label is the largest resolution and the other resolutions will always be a constant size. Funko displays the "_large" image on their sites, so be removing the label, we will always post thee largest resolution image possible to reddit. This also has the added benefit of (hopefully) silencing the "MaxImageBot" that comments on the News posts with links to the larger resolution images.

Thursday, May 9, 2019

Changelog 2019-05-09 - One Fix

Fewer false positives from target.com

One of the purchase button text options on target.com is "Add for shipping." However, there does not seem to be any logical pattern to when this option is presented. Sometimes, I product will have that option available and can be shipped anywhere, and sometimes it will have it but can be shipped nowhere.

It turns out that a more reliable method of checking if something can be shipped is checking if Target offers free shipping on the product. However, it is not enough to filter on "free two-day shipping" because not everything has 2-day shipping. Considering we are already capturing the text in the product card to tell what the text is present on the purchase button, added another check for the word "free" will help make sure we only alert on items that are available for shipping.

Monday, May 6, 2019

Changelog 2019-05-06 - One Fix

Amazon has its own Twitter account

Follow @FunkoAmazon for Funko-related in-stock and restock posts. This change also removes automated posting from Amazon to @FunkoShopAlert. @FunkoShopAlert will now once again only post when products come in stock from funk-shop.com

Sunday, May 5, 2019

Changelog 2019-05-04 - Two Fixes

Target RegEx fixed

The Target scraper was missing products because of some site changes to target.com. Edits to the RegEx fixed the issue and future-proofed to some degree, in case Target ever reverts their website back to the way it was before

Target scraper now actually scraps all items

There were a few issues previously that were impacting the Target scraper. Because target.com is a dynamically constructed website, products at the bottom of the page were not loaded until you scroll at or past them. A fix to the scraper to execute a javascript command to scroll to the bottom of the page before scraping the HTML ensures that all items are loaded before scraping.

Another issue was with scraping multiple pages on target.com. Because not every item being searched for can fit on one page, the scraper needs to look at three different web pages. Each webpage has a unique URL so scraping each one individually should have worked. However, it turns out target.com is setting a cookie in the browser when you visit the first page which allows you to visit the subsequent pages. If you navigate directly to any page other than the first page, it redirects you to the first page. This meant I was scraping the same page multiple times rather than each page once. I change to make sure the cookies were maintained allows the scraper to visit all relevant pages without a problem.

Thursday, May 2, 2019

Changelog 2019-05-02 - One Fix

Funko Blog Scraper should miss fewer images now

An issue where image urls would sometimes have a leading "https:" would cause the blog scraper to miss some images when making the compiled image. Changes to the regex for parsing the page should help with obtaining all images.

Hot Cash Give Away Jan 2021

  Hey everyone! Time for another round of Hot Cash codes! Hot Cash ends soon so be sure to use these ASAP! Comment below with the codes you ...