The Art of Content Subscription
#1
Scholar 
(04-23-2023, 10:37 PM)user328 Wrote: As you may recall, I worked for a newspaper for about 9 years. While I was there, one of the system I maintained was a vendor feeds system that pulled in syndicated content from Associated Press and other sources.

I want to make something similar that loads RSS feeds from various sites and displays the headlines in a scroller.

The newspaper's vendor feed system was a hodge podge of PHP and shell scripts written by numerous programmers over the years. When I took over maintenance duties, some of the scripts were so cryptic and convoluted that I literally had to sit down with pen and paper and reverse engineer them every time I needed to make a simple change.

Over time, I rewrote a lot of the scripts to be easier to read and modify. Changes that took days to make before could now be done in an hour or two -- modified, tested, and pushed to production. Most notably, I created the XML parser base class mentioned elsewhere that could be extended to parse just about any new feed the paper subscribed to.

It always seemed to me that something more could be done to simplify and streamline the system though. Although I didn't know exactly how I'd go about it at the time, I had the idea that the system could be refactored as a pipeline of standardized modules; i.e., a handful of modules from a relatively small set could be chained together to import each feed. None of this business of writing a whole new script for every single feed.

That's what I wanted to do, but I never found the time.

This week, I've made considerable progress towards building such a system. The new system is divided into a few distinct stages. Filters can be plugged in between stages to make minor changes to the data, so that the standard modules can process it without needing to be modified themselves.

1. Pre-download filtering
2. Download the feed with a standard FTP or HTTP module
3. Pre-parse filtering
4. Parse the feed with a standard RSS, Atom, or JSON module
5. Pre-import filtering
6. Import the feed articles into the database and download media attachments with a standard FeedImport module
7. Post-import filtering

I'll go over some use cases for the several filtering stages later.
Reply
#2
(04-29-2023, 06:13 PM)user328 Wrote: I'll go over some use cases for the several filtering stages later.

Much later, in fact. I found bigger fish to fry.

To my dismay, I learned whilst editing code last night that my local working copy of the site doesn't contain changes I made to the live site a couple of years ago. Those changes must've been lost in the last hard drive crash.

While I now have a cron task making not one but two nightly rsync backups of the working copy to separate USB drives, that won't bring back the lost work. Unfortunately, that means I'll have to shelve any new features and focus on the fixes I had already planned for the existing site.
Reply
#3
Oh my God, that is pretty much every webmaster's worst fear.
Reply
#4
This is no huge problem. The main scripts don't need much modification. I mainly need to work on preventing AIs from stealing content. There are ways to ensure only logged in members can run those scripts.
Reply
#5
happyface 
(05-03-2023, 03:23 PM)user328 Wrote: This is no huge problem. The main scripts don't need much modification. I mainly need to work on preventing AIs from stealing content. There are ways to ensure only logged in members can run those scripts.

no you mainly need to work on your site working that would be a start lol
Reply
#6
Oh, yay! The last person on earth I'd consider taking software design advice from dutifully chips in.
Reply
#7
Laugh
Reply
#8
(05-04-2023, 12:39 PM)Chatwoman Wrote: Laugh

https://imgur.com/a/NzDokVd
Reply
#9
Blink2 
Oh that's FUCKED up.
Reply
#10
Okay, I'm seeing more value in this RSS feed thingy as far as user customization and whatnot after watching this video.



I've stopped thinking about individual scrollers and list boxes for everything. It's all moving towards a unified live feed / chat / command window. A social media terminal, if you will. The integrated news reader will allow users to choose what third party content appears in their feed.
Reply
#11
I love RSS feeds.
Reply
#12
happyface 
RSS feeds you 2 are to young for them reminds me of IRCĀ  Big Grin
Reply
#13
XML was only drafted in 1999. RSS is newer than that, being an XML format.
Reply
#14
Me and MO were owning the fuck out of the interwebz before they even ran cable out to ya sheep farm, gramps.
Reply


Please note that new posts in this forum must be approved by a moderator before becoming visible.
[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)



















Disclaimer | Terms Of Service | Privacy Policy