Sunday Afternoon Mac OS

Posted on  by

NOTE: The latest versions of Adobe Reader do not support viewing PDF files within Firefox on Mac OS and if you are using a modern (Intel) Mac, there is no official plugin for viewing PDF files within the browser window. Dear Lifehacker, Sierra is out today and some of the new features, like Siri, look pretty great. Of course, it seems like a small enough upgrade, but that doesn’t mean things won’t go bad. Mac Games Home; New Releases Mac Games. This game will not work on your operating system. It is the perfect game for a relaxing Sunday afternoon. Contact Apple support by phone or chat, set up a repair, or make a Genius Bar appointment for iPhone, iPad, Mac and more. McPherson American Legion – 401 N. Main A great Sunday afternoon activity for the whole family! The Early Bird Game starts at 2:30 p.m. And the Regular Game will begin at 3:15 p.m.

Home Deals Tech Specs Articles Groups Software Support @LowEndMac

Low End Mac'sOnline Tech Journal

Website Automation with PHP and MySQL, Part 16

Sunday Afternoon Mac Os Download

Dan Knight - 2003.02.27

It's been a long time since I've added any automation to thesite, although I have made a few tweaks to existing automation, butthis week we added one more significant piece to our ongoing siteautomation project, an automatically generated RSS news feed.

What's RSS?

An RSS (Rich Site Summary) news feed is a text file that otherscan use to find out what's new on your website. There's a standardformat for these documents, which includes things like the domainname and URL, email for the webmaster, when the latest update tookplace, along with article titles, their URL, and usually a briefdescription or teaser.

There's a good introduction to them in Using RSS NewsFeeds.

I've been generating RSS news feeds for Low End Mac for a longtime. Quite frankly, it's a tedious business. I've been slackingoff on doing them because of the time involved. What time I have,I'd rather spend writing, editing, designing, trying to keep on onemail.

And after about an hour or so of coding and debugging, I don'thave to manually create an RSS feed any longer. PHP uses the sameMySQL database that already tracks site content to generate a newsfeed.

Here's a snippet of the last one I created manually:

The header only has one tricky part - the date. Everything elseup there remains the same. The items change each day that we addnew content. The tags pretty much explain the parts, which is avery nice feature of an RSS news feed.

The Program

I'm not going to give you the whole program. Program code willbe set in monospace type and comments will be in regular type.

This was one of the tricky parts. Since the RSS newsfeed file,rss.txt, is in the root directory, I had to find out from oursystem administrator just how to write the file to the correctspot. During testing, I wrote it to the same directory I waswriting the script in. (The r indicates a return.)

We also had to have things set up on the server so we hadpermission to write the file. Without that, none of this works.

The above line starts writing the text file with our news feed.This part only changes once a year as we update the copyrightnotice.

The next chunk of code is used to post the correct date and timein our file:

The first line checks the current time and compares this withthe latest timestamp in our MySQL database that's earlier than now.(We do this to assure that content scheduled for later releasedoesn't get posted in the news feed early.)

We then post the day, date, time, and time zone as thepublication date. This will always match the moment when the mostrecent article went live.

UPDATE: The format we originally presented was incorrect andincluded am/pm between the time and time zone - h:i:s a T- which produces an invalid RSS feed. Please use <http://feeds.archive.org/validator/>to validate your feed before sharing it with the world.

Next we close the publication date, describe the site, providethe base URL for Low End Mac as well as the site's name, andprovide the URL and dimensions for a site graphic.

Here we provide the email address for the webmaster and managingeditor, which in our case is the same person. Someone having aproblem with the news feed could use this to contact us and let usknow about the problem.

Low End Mac is published in English, and most of our writers useUS English. So we cover that next.

We can tell what hours and days the site isn't updated, which isdone in GMT. For those outside the UK, this can involve some headscratching. Basically we don't publish new articles between 9:00p.m. and 6:00 a.m. (We try to have our publishing day done by noonEastern Time to make time for lunch, email, and my other job.)

Sunday afternoon mask

The Meat

That's all header. Except for the time stamp, it doesn't change.From here on, we're creating content based on information in ourMySQL database.

First up, get today's articles, starting with the most recentlypublished:

This is pretty similar to the code we use to display pagesthroughout the site. Instead of using just the title of the articleas a link, we also include the name of the author and the columnname as part of the title.

Following the new articles, we check our database to see if wehave an archive covering this date in Mac and LEM History. Mostdays we do, but about once a month there's a date we still haven'tposted new content on. Except for holidays, most of those willdisappear as we add content almost every weekday.

The above code checks for the next previous date in ourdatabase, giving it the flexibility to work around holidays andweekends. It then lists that day's content ranked by popularity.The article that received the most traffic is listed first, workingdown to the best deals of the day, where we don't bother countingclicks.

We modify the above code once more to provide a third day in ourfeed, and then we close the text file.

To read the current rss.txt file, clickhere. And if you're using OS X, download NetNewsWire Lite, add Low EndMac, and let software tell you when your favorite websites have newcontent.

As I write this, we're running the script manually, but thefolks at BackBeat will be setting this up as a cron job that willautomatically run every 5 minutes. This is the kind of tediumcomputers were designed for!

Other Updates

A couple weeks ago we changed the way we list our new content onthe LEM home page. Instead of a bullet list, we display the articletitle using the term style (<dl>) in bold type, followed bythe author, column name, and publication date in italic and adescription in plain text. The latter two lines are styled asdefinition (<dd>).

We've received very positive feedback on the change. Here's anexample from yesterday:

Switching from Mac to Windows,really clearing a hard drive, OS X and viruses, RAM disks, andmore
Dan Knight, Low End Mac Mailbag, 02.26
More on replacing Claris Home Page, printing from a classicMac, getting a CD-RW drive to work with a Performa, SpamBouncer,and why some G4s won't work in G3s.

Sunday Afternoon Mac Os Catalina

We also discovered a problem one Sunday afternoon when wediscovered Monday content was being displayed below Friday'scontent. Looking over the PHP script, we found that we were lookingfor the most recent date != (PHP's way of saying 'notequal') to the most recent date matching or before today's date.Changing that to < solved the problem.

I'm still far from an expert on PHP, and I'd be lost withoutsome assistance from Dave Hamilton at BackBeat Media (they handleour ads and our servers) and two of my sons. Brian and Stephen'shelp has been invaluable at finding typos and other problems tocrop up so easily. You'll be able to check out their programmingabilities soon when the launch their third virtual pet, secondrobotic virtual pet, and ultimate virtual robot pet site.

Next project: Using PHP and MySQL to generate our daily newsreleases.

Join us on Facebook, follow us on Twitter or Google+, or subscribe to our RSS news feed

Today's Links

  • Mac of the Day: iMac G5 (iSight), introduced 2005.10.12. Apple built an iSight webcam into the last version of the G5 iMac.

Recent Content

  • Go to our home page for a listing of recent content.
Mac

Low End Mac is an independent publication and has not been authorized,sponsored, or otherwise approved by Apple Inc. Opinions expressed arethose of their authors and may not reflect the opinion of CobwebPublishing. Advice is presented in good faith, but what works for onemay not work for all.
Entire Low End Mac website copyright ©1997-2016 by Cobweb Publishing, Inc. unless otherwise noted. Allrights reserved. Low End Mac, LowEndMac, and lowendmac.com aretrademarks of Cobweb Publishing Inc. Apple, the Apple logo, Macintosh,iPad, iPhone, iMac, iPod, MacBook, Mac Pro, and AirPort are registered trademarks of AppleInc. Additional company and product names may be trademarks orregistered trademarks and are hereby acknowledged.
Please report errors to .
LINKS: We allow and encourage links toany public page as long as the linked page does not appear within aframe that prevents bookmarking it.
Email may be published at our discretion unless marked 'not forpublication'; email addresses will not be published without permission,and we will encrypt them in hopes of avoiding spammers. Letters may beedited for length, context, and to match house style.
PRIVACY: We don't collect personalinformation unless you explicitly provide it, and we don't share theinformation we have with others. For more details, see our Terms of Use.

Follow Low End Mac on Twitter
Join Low End Mac on Facebook

Favorite Sites

MacSurfer
Cult of Mac
Shrine of Apple
MacInTouch
MyAppleMenu
InfoMac
The Mac Observer
Accelerate Your Mac
RetroMacCast
The Vintage Mac Museum
Deal Brothers
DealMac
Mac2Sell
Mac Driver Museum
JAG's House
System 6 Heaven
System 7 Today
the pickle's Low-End Mac FAQ

Affiliates

Amazon.com
The iTunes Store
PC Connection Express
Macgo Blu-ray Player
Parallels Desktop for Mac
eBay

Advertise

Sunday Afternoon Mass Near Me

All of our advertising is handled by BackBeatMedia. For price quotes and advertising information,please contact at BackBeat Media(646-546-5194). This number is for advertising only.