Blog Post

MagpieRSS & Website Updates

Kordel

I’ve spent the last several days fiddling around with Magpie RSS, attempting to feed Blog updates onto my home page via RSS.

Well, you’d think it should be easy, as I found no fewer than a dozen “simple” tutorials on parsing the output via PHP and customizing the feeds. But of the 5 or 6 different scripts that were freely available, only the last one I found actually worked.

The funny thing is, as I brushed up on my PHP, I realized that the issues were mostly very simple ones – syntax, mostly, and bad programming. You’d think people who write Magpie / PHP walkthrough’s would test their code…

Anyway, it’s up and running, and it’s working great – you can now view summaries of the latest Blog posts directly at www.eberlysystems.com – our Home page, plus breaking news as it becomes available.

For anyone who is interested in what I came up with, here’s the basics…

  • Download MagpieRSS from http://magpierss.sourceforge.net/
  • Install per the included “Install” file (open via your web browser – it’s in HTML format)
  • Insert this PHP script into your page and customize the lines in bold
  • Enjoy!

Script:

<?php
require_once(‘ magpierss /rss_fetch.inc’);
$rss = fetch_rss(‘ https://www.eberlysystems.com/blog/wp-rss.php ‘);
if ( $rss) {

#in this case, we only want to display the first four news feeds:
$short_items = array_slice($rss->items,0,3);

#to be polite, set magpie to only refresh a feed once every half-hour:
define(‘magpie_cache_age’, 900); # 30 x 60 = 1800 seconds

#tell magpie to use utf-8 encoding
define(‘magpie_output_encoding’, ‘utf-8’);
define(‘magpie_input_encoding’, ‘utf-8’);
define(‘magpie_detect_encoding’, ‘false’);

#now we tell magpie how to format our output
foreach ($short_items as $item) {

#define the link to the story as $href
$href = $item[‘link’];

#set the item title as $title
$title = $item[‘title’];

#set the item content as $longdesc
$longdesc = $item[‘description’];

#to only display the first 60 characters of the title and
#the first 100 characters of the content:

$desc = trim(strip_tags($longdesc));
if (strlen($desc) >= 175)
{
$desc = substr($desc,0,174).”…”;
}
if (strlen($title) >= 25)
{
$title = substr($title,0,24).”…”;
}

#and now we want to put it all together to show the image icon,
#followed by the item title, followed by the content on a new
#line in a smaller font.
echo “ <h2 align=center><a href=”$href”>$title</a><br /><span>$desc</span></h2> “;
}
}
?>

Happy New Year to everyone in case I don’t get to update again before 2010!

By Eberly Systems 02 May, 2024
West Lawn, PA, May 2, 2024 — Eberly Systems , the West Lawn-based managed IT services and managed voice provider, today announces its acquisition of the Lebanon-based LYLAB Technology Solutions. Eberly Systems seeks to further a movement of people who are motivated and equipped to make a difference in their world through their daily work. They believe in building lasting partnerships based on trust and transparency while delivering industry-leading solutions to support and protect critical business assets. Driven by the principles of people, excellence, integrity, and stewardship, the team prides itself on partnering with companies to securely, reliably, and efficiently grow their businesses. “We cannot be more excited to join forces with the LYLAB team,” comments Kordel Eberly, Eberly Systems President & Founder. “ The integration of LYLAB Technology Solutions into Eberly Systems solidifies our commitment to providing small businesses with unparalleled service and support. We’re proud of this new opportunity to carefully design and manage the IT infrastructure and systems of even more local businesses and communities.” The acquisition solidifies the Eberly Systems commitment to supporting businesses in Lebanon County. Merging the two teams together as one entity offers the collective team the benefit of enhancing capabilities, refining processes, and extending reach to better serve the evolving needs of small businesses in the surrounding area. Future plans include expanding their presence into Lancaster County.
computer help with IT support
By Eberly Systems 16 Jan, 2024
A trusted MSP can be your invaluable strategic partner.
By Eberly Systems 02 Jan, 2024
These 5 key features of Office 365 Business Premium make it essential for businesses to have.
set of keys
By Eberly Systems 19 Dec, 2023
Eberly Systems has been hard at work over the last year in a concerted effort to enhance the security posture of our clients’ information technology environments. Here are the quarterly updates.
construction site
By Eberly Systems 03 Jul, 2023
After years of steady growth, the workforce at a construction development and property management company was becoming increasingly frustrated by disorganized data. Eberly Systems deployed a hybrid cloud storage solution for efficiency and secure data access.
By Nate M. 01 Jun, 2023
SharePoint file storage has both features and limitations that you should be aware of while storing and accessing files. Here's a rundown.
By Nate M. 05 Jan, 2023
These are the Eberly Systems recommendations for creating good passwords in 2023.
By Eberly Systems 15 Dec, 2022
Every business relies on phones and a phone service. In accordance with Eberly Services Managed IT, we offer Managed Voice solutions for both handheld and softphones supported by our stellar sales and help desk teams.
By Eberly Systems 04 Oct, 2022
Eberly Systems is proud to offer new services around managed endpoint detection & response, cloud security, business internet brokerage, and unlimited projects.
By Becky 22 Sep, 2022
Annual fundraisers offer a great opportunity to use company paid volunteer time off.
More Posts
Share by: