SEO Cheat Codes Part 3: a blog like RSS feed for new pages on a site


The script … This is old, dates to 2007, and not cleaned up … The effects of using this type of script are not as pronounced now that Google is indexing sites faster.

#!/usr/local/bin/perl

print “Content-type: text/html\n\n”;

$pubDate = gmtime(time());
($day, $mon, $date, $time, $year) = split(” “, $pubDate);
$pubDate = “$day, $date $mon $year $time GMT”;

print “$pubDate +0000<p>”;

read(STDIN,$buffer,$ENV{CONTENT_LENGTH });

#print “$buffer<p>”;

($link, $title, $description, $password) = split(“\&”, $buffer);

#Fields on form must be in order to use this script – This is a intentional non-standard requirement

# process each field differently We are going to do this charactor by charactor this is not a loop that requires speed

if ($password eq “password=obama”) {

$link =~ /\=/; $link=”$'”;
$link =~ s/\%2F/\//g;
$link =~ s/\%3A/\:/g;
$link =~ s/\%23/\#/g; # #

$title =~ /\=/; $title=”$'”;
# the act of posting data changes these.
$title =~ s/\+/\ /g;

$title =~ s/\%21/\!/g; # !
$title =~ s/\%22/\”/g; # “
$title =~ s/\%93/\”/g; # “
$title =~ s/\%23/\#/g; # #
$title =~ s/\%24/\$/g; # $
# %25 the % symbol shift 5 modified last for programming reasons
$title =~ s/\%27/\’/g; # ‘
$title =~ s/\%3A/\:/g; # :
$title =~ s/\%3B/\;/g; # ;
$title =~ s/\%3D/\=/g; # =
$title =~ s/\%3F/\?/g; # ?
$title =~ s/\%5B/\[/g; # [
$title =~ s/\%5C/\\/g; # \
$title =~ s/\%5D/\]/g; # ]
$title =~ s/\%60/\`/g; # `
$title =~ s/\%7B/\{/g; # {
$title =~ s/\%7C/\|/g; # |
$title =~ s/\%7D/\}/g; # }
$title =~ s/\%7E/\~/g; # ~

# extended charactors that could be cut and pasted
$title =~ s/\%92/\’/g; # ‘
$title =~ s/\%93/\”/g; # “
$title =~ s/\%94/\”/g; # “
$title =~ s/\%E9/\’/g; # ‘

# 1-9+
# @ symbol is not modified when pasted
$title =~ s/\%5E/\^/g; # ^
$title =~ s/\%28/\(/g; # (
$title =~ s/\%29/\)/g; # )
# _ is unchanged
# + last but not least

$title =~ s/\%2F/\//g; # /
$title =~ s/\%2C/\,/g; # ,

# last but not least
$title =~ s/\%26/\&/g; # &
$title =~ s/\%3C/\&lt;/g; # <
$title =~ s/\%3E/\&gt;/g; # >
$title =~ s/\%2B/\+/g; # + symbol
$title =~ s/\%25/\%/g; # Yes the % symbol should be embeded

### newbies
$description =~ s/\%E1/á/g;
$description =~ s/\%ED/í/g;

### newbies patches need to be moved to main post.pl program

$description =~ /\=/; $description=”$'”;
$description =~ s/\+/\ /g;

$description =~ s/%0D%0A/\n/g; # new line in textarea … needs to be displayed as a <p> but depends on processor.

$description =~ s/\%22/\”/g; # “
$description =~ s/\%27/\’/g; # ‘
$description =~ s/\%2C/\,/g; # ,
$description =~ s/\%2F/\//g; # /
$description =~ s/\%3A/\:/g; # :
$description =~ s/\%3B/\;/g; # ;
$description =~ s/\%3D/\=/g; # =
$description =~ s/\%3F/\?/g; # ?
$description =~ s/\%7B/\{/g; # {
$description =~ s/\%7C/\|/g; # |
$description =~ s/\%7D/\}/g; # }

$description =~ s/\%7E/\~/g; # ~
$description =~ s/\%5B/\[/g; # [
$description =~ s/\%5C/\\/g; # \
$description =~ s/\%5D/\]/g; # ]

$description =~ s/\%60/\`/g; # `
$description =~ s/\%92/\’/g; # ‘
$description =~ s/\%93/\”/g; # “
$description =~ s/\%94/\”/g; # “
$description =~ s/\%96/–/g; # —
$description =~ s/\%97/–/g; # —

# 1-9+
$description =~ s/\%21/\!/g; # !
$description =~ s/\%23/\#/g; # #
$description =~ s/\%24/\$/g; # $
$description =~ s/\%26/\&/g; # &
$description =~ s/\%5E/\^/g; # ^
$description =~ s/\%28/\(/g; # (
$description =~ s/\%29/\)/g; # )

# last but not least
$description =~ s/\%26/\&/g; # &
$description =~ s/\%3C/\&lt;/g; # <
$description =~ s/\%3E/\&gt;/g; # >
$description =~ s/\%2B/\+/g; # + symbol
$description =~ s/\%25/\%/g; # Yes the % symbol should be embeded

print “<dt><a href=\”$link\”>$title</a><dd>$description<p>”;

open(DATA, “feed.xml”);
$good = read DATA, $xml, 100000;
close(DATA);

open(XML , “>feed.xml”);

print XML “<?xml version=\”1.0\” encoding=\”utf-8\”?>\n”;
print XML “<!– generator=\”ENTER YOUR INFO HERE\” –>\n”;
print XML “<rss version=\”2.0\” xmlns:atom=\”http://www.w3.org/2005/Atom\” xmlns:content=\”http://purl.org/rss/1.0/modules/content/\” xmlns:wfw=\”http://wellformedweb.org/CommentAPI/\” xmlns:dc=\”http://purl.org/dc/elements/1.1/\”>\n”;
print XML ”  <channel>\n”;
print XML ”    <atom:link href=\”ENTER YOUR FEED HERE\” rel=\”self\” type=\”application/rss+xml\” />\n”;
print XML ”    <title>SITE TITLE</title>\n”;
print XML ”    <link>http://www.YOURDOMAIN.com/</link&gt;\n”;
print XML ”    <description>Headline</description>\n”;
print XML ”    <pubDate>$pubDate</pubDate>\n”;
print XML ”    <generator>YOUR INFO HERE</generator>\n”;
print XML ”    <language>en</language>\n”;
print XML ”       <item>\n”;
print XML ”         <title>$title</title>\n”;
print XML ”         <link>$link</link>\n”;
print XML ”         <pubDate>$pubDate</pubDate>\n”;
print XML ”         <guid isPermaLink=\”false\”>$link</guid>\n”;
print XML ”         <description>$description</description>\n”;
print XML ”       </item>\n”;
$count = 27;
while ($xml =~ /<item>(.+?)<\/item>/s) {
if ($count) {
print XML ”       $&\n”;
$count = $count-1;
}
$xml =”$`$'”;
}
print XML ”  </channel>\n”;

print XML “</rss>\n” ;
close(XML);}

Ping using http://pingomatic.com/ping/

Notes: the pages should be in directories under in this example <link>http://www.YOURDOMAIN.com/</link&gt; and pages can only be posted through a blog feed once.

<link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”http://www.YOURDOMAIN.com/released/feed.xml” />
is added to the meta tags for the site.

Advertisements

One response

  1. […] Sites need to vary methods of where they get traffic from and how they organize their content. A blog is one method, Static content is another, fresh non-blog content is still yet another. mixing content is no […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: