Hello,
I was able to fine tune the Google feeds fetched by Feed2Post. I have replaced the bottom of utilities.php in com_feedpost_25 and utilitiescron.php in conjob_feed2post_16 with the following:
| Code: |
function parselinks ($datatext) {
$text = preg_replace("#<table border=0 width= valign=top cellpadding=2 cellspacing=7><tr><td valign=top><br><div><img alt=\"\" height=\"1\" width=\"1\"></div><div>(.*?)</nobr><br>#si", "", $datatext);
$text = preg_replace("#<table border=0 width= valign=top cellpadding=2 cellspacing=7><tr><td width=80 align=center valign=top><a(.*?)\"><img src=#si", "<img style=\"margin: 0 10px 10px 0; float: left;\" src=", $text);
$text = preg_replace("#border=\"1\" /><br>(.*?)</nobr><br>#si", "border=\"1\" />", $text);
$text = preg_replace("#</div></td></tr></table>#si", "</div>", $text);
$text=preg_replace("/<a\s+/","<a target=\"_blank\" rel=\"nofollow\" ",$text);
return $text;
}
|
This will remove the double title; since the title is already in the article it was redundant to have it again in the text.
If there is an image in the feed, it will also float left. It will also change the tags into div tags.
Also another problem I found with Google is that many times an apostrophy would show gibberish. To solve this I have added the following code into admin.feedpost.php at line 283, posthemall.php at line 80 and cronfunctions.php at line 163:
| Code: |
$title=preg_replace("|'|","'",$title);
|
These changes shouldn't affect other types of feeds since the changes are very specific to the html that Google produces. You are welcome to use these modifications if you wish.