Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 657637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:50:46+00:00 2026-05-13T22:50:46+00:00

I am trying to write a very simple RSS channel which would display the

  • 0

I am trying to write a very simple RSS channel which would display the current day’s comic strip from sinfest.net, but I cannot force it to display anything but the linked title.
Link to one of the code versions:

<?php
$page = file_get_contents('http://www.sinfest.net/index.php');
$title = '';
$description = '';
$link = '';
$date = date("Y-m-d");
if (preg_match('~<img src="(http://sinfest\\.net/comikaze/comics/.*\\.gif)" alt="(.*)" border="0" />~isU', $page, $match)) {
        $title = $match[2];
        $description = "<img src='{$match[1]}'/>";
}
if (preg_match('~<a href="http://sinfest\\.net/archive_page\\.php\\?comicID=([0-9]*)"><img src="images/prev_a.gif"~isU', $page, $match)) {
        $link = 'http://sinfest.net/archive_page.php?comicID=' . ($match[1]+1);
}
$ok = $title && $description && $link;
$image = "http://www.sinfest.net/comikaze/comics/" . $date . ".gif";
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>';
echo '<rss version="2.0">
        <channel>
                <title>Latest Sinfest</title>
                <link>http://www.sinfest.net/</link>
                <description>Latest Sinfest</description>
                <image>
                      <url>' . $image . '</url>
                      <title>' . htmlspecialchars($title) . '</title>
                      <link>' . htmlspecialchars($link) . '</link>
                </image>';
if ($ok):
echo '               <item>
                        <title>' . htmlspecialchars($title) . '</title>
                        <link>' . htmlspecialchars($link) . '</link>
                        <description><img src="' . $image . '" /></description>
                        <enclosure url="' . $image . '" type="image/jpeg" />
                </item>';
elseif (!isset($_GET['noerror'])): 
echo '                <item>
                        <title>Error parsing news.' . date('Y-m-d H:i:s') . '</title>
                        <link>about:blank</link>
                        <description>Error parsing news.</description>
                </item>';
endif;
echo '        </channel>
</rss>';
?>

The RSS-only code (I didn’t remove the PHP variables):

<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
    <channel>
        <title>Latest Sinfest</title>
        <link>http://www.sinfest.net/</link>
        <description>Latest Sinfest</description>
        <image>
            <url>' . $image . '</url>
            <title>' . htmlspecialchars($title) . '</title>
            <link>' . htmlspecialchars($link) . '</link>
        </image>
        <item>
            <title>' . htmlspecialchars($title) . '</title>
            <link>' . htmlspecialchars($link) . '</link>
            <description><img src="' . $image . '" /></description>
            <enclosure url="' . $image . '" type="image/jpeg" />
        </item>
    </channel>
</rss>

Any idea what am I doing wrong and some piece of advice maybe? Thank is advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:50:46+00:00Added an answer on May 13, 2026 at 10:50 pm

    Your best bet is to CDATA that image section (alternatively you can “htmlentities()” it, but this is better!)

    <description><![CDATA[<img src="' . $image . '" />]]></description>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a very simple Android application that checks the signal
I am trying to write a very simple statement that will make it so
I'm trying to write a very simple/minimal custom video player in Flash CS3 I
I'm trying to write a very simple Python utility for personal use that counts
I'm trying to write a very simple plugin that on anchor mouseover increases the
I'm trying to write a very simple terminal app that will scan for Bluetooth
I am trying to write a very simple application that allows me to enter
I'm trying to write a very simple image processing program for fun and practice.
I'm trying write a query to find records which don't have a matching record
I'm trying to write a blog post which includes a code segment inside a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.