This runs on a 1 minute CRON job so in theory I should get alerted of any matching articles within 60 seconds of them being published. If there are any matches, these get added to an array which is later looped over in order to send a push notification via OneSignal containing the title, article summary, and the URL. Once the articles are fetched, I ignore any that I’ve already seen before (worked out by storing the ids in my database after each run) and then proceed to do a case insensitive check for my keywords against both the title and content of the article. It has support for ETag caching so I store the latest tag to avoid unnecessary loading on their end as this script will run every 60 seconds. $db_name, $db_user, $db_pass ) $pdo -> setAttribute ( PDO :: ATTR_ERRMODE, PDO :: ERRMODE_EXCEPTION ) $pdo -> setAttribute ( PDO :: ATTR_DEFAULT_FETCH_MODE, PDO :: FETCH_ASSOC ) $headers = $url = '' $ch = curl_init ( $url ) curl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, true ) curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true ) curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false ) curl_setopt ( $ch, CURLOPT_TIMEOUT, 30 ) curl_setopt ( $ch, CURLOPT_USERPWD, ) curl_setopt ( $ch, CURLOPT_HTTPHEADER, ) curl_setopt ( $ch, CURLOPT_HEADERFUNCTION, function ( $curl, $header ) use ( & $headers ) įeedbin provide an API for fetching the latest articles from all of your feeds. The real work is to fetch the latest feeds from my Feedbin account and then search each article for any matching text strings: $pdo = new PDO ( "mysql:charset=utf8mb4 host=". The fetch, add, and delete commands are all sent to an incredibly basic PHP API I wrote which syncs to my MySQL database. The + button in the top right presents a UIAlertController with a text field for adding a search term. It consists of a table view listing my search terms and each row can be swiped to delete the term. The iOS app is ridiculous simple so I’m not going to spend too much time describing that. Instead I found this Mario crossover at Snorgtees which was perfect. I shortened it down to just “Seymour” and decided this was a perfect name as it was letting me “See More” of the things I wanted to see.Īs the app isn’t going to be released publicly I did a Google Image Search for “Feed Me Seymour” in the hope of finding some sort of silhouetted version of the singing plant. I was saying them out loud in bed whilst working on the app and my wife instinctively said “ Feed Me Seymour”. I wanted to do some kind of play on words with Feedbin and was looking at things like “Feed Trash Can” or “Feed Trough” but I didn’t really like any of them. Sometimes this can be a days long process but for this app it was relatively quick. Like most other developers, I start a side project with the most important decision choosing a name. The types of articles I’m interested in require me to act within around 15 minutes so too slow for Google News which typically takes 12-24 hours to send a notification. I already do for some things 3 but it’s far too slow for my use case. “Couldn’t you just use Google News notifications?”. As I couldn’t trust it would do what I needed it to, I decided it was quicker and easier to just build it myself. There was also no detail on how regularly the checking was done and whilst I managed to get a notification for the term “apple” I couldn’t get it to work for much else. It only supports one search term and the examples all use single words which didn’t give me total faith that the phrase “rise of the resistence OR space 220 OR fastpass” would parse correctly. I use the excellent Feedbin service 2 to keep up with my feeds and it turns out they have an app called Feedbin Notifier, but it doesn’t seem to work. Fortunately I was still able to grab one of the remaining fastpasses for later in my holiday but I was determined that this shouldn’t happen again… When the announcement finally came, I didn’t see it for 5 hours as I was busy and hadn’t been checking my numerous theme park RSS feeds 1. The issue is that a new ride, Mickey & Minnie’s Runaway Railway, is due to open whilst I’m there but fastpasses were not yet available to be booked as the opening date hadn’t been formally announced. I’m travelling to The Happiest Place On Earth™ next week and as I’m staying in a Disney hotel I was able to book fastpasses for rides 60 days in advance. The Apple Watch app isn’t quite ready yet so instead I’m going to show you “Seymour”, an app that sends me push notifications when relevant articles are posted online. I’ve cheated slightly this month by working on two side projects a simple iOS app and a SwiftUI watchOS app. As with all of my side projects, I’m not focused on perfect code or UI it just needs to run! This is part of a series of blog posts in which I showcase some of the side projects I work on for my own use.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |