juust ~ php oddities

Unordered list of one element
  • rss
  • begin
  • about
    • vcard
    • WTF is BroJesus
  • php scripts
    • flickr wp widget
    • google multi key serp tool, php script
    • gwt plugin
  • php classes
    • php pagerank class
    • fibonacci class
    • robots.txt parser php class
  • serp
    • serp dashboard wordpress plugin
  • services

phpLD mod : context sensitive RSS

juust | 21/08/2008

(in case you’re wondering : this is about a small rss plugin for a php link directory site I am setting up, see example : links.trismegistos.net/blogs/).

I tried some free RSS mod but that dont work, I get the same yahoo rss feed on every page. I want context sensitive rss.

Why ? to improve my keyword/content ratio per page and get more pages indexed. I hear 2-5% (1 in 50/20 words) is the ideal ratio if you want to be considered a highly relevant result page on the keyword-content ratio. A list with website links in the category ‘music – classic’ has a very high ratio keyword/content and google won’t index the page. Adding a pot-luck grab of google blogsearch results might level that a little.

So I am gonna add some relevant fresh rss feeds from google blogsearch.

Same trick as the pagerank plug-in, the last part of the url contains the subcategory, I can use these as keywords for google blogsearch :

  1. $PT = $_SERVER["REQUEST_URI"];
  2. $ttl = explode('/', $PT);
  3. $mykeys = $ttl[count($ttl)-2];
  4. $mykey=trim(preg_replace('/_/', ' ', $mykeys));
  5. $xmlSource="http://blogsearch.google.com/blogsearch_feeds?hl=en&c2coff=1&lr=&safe=active&as_drrb=q&as_qdr=d&q=".urlencode($mykey)."&ie=utf-8&num=5&output=rss";
  • I take the URI
  • explode it on the / slashes
  • take the last text
  • replace ‘_’ with spaces
  • and urlencode the keywords for google blog-search.

A generic rss parser handles the xml file, i delimit it to 5 results to keep traffic down. I add some class markers in the script to be able to add extra markup in a .css file, and I save the result to $thisfeed.

  1.  foreach($result as $arr){
  2.  $strResult .= '<div class="rssdiv">';
  3.  $strResult .= '<div class="rss_title"><h3>'.$arr["title"].'</h3></div>';
  4.  $strResult .= '<div class="rss_description">'.$arr["description"].'</div><br />';
  5.  
  6.  $strResult .= '<div class="rss_link"><a href="'.$arr["link"].'" rel="nofollow" title="'.$arr["title"].'">more: "'.$arr["title"].'"</a></div>';
  7.  $strResult .= '</div>';
  8. }
  9.  
  10. $tpl->assign('thisfeed', $strResult);

I call the store feed in the footer with {$thisfeed}
and include the sourcefile in index.php with
require_once ‘readrss.php’;
just below require_once ‘init.php’;

See example : links.trismegistos.net/blogs/

Now I am going to add a single google adsense slot, not too loud, just enough to get Google to come crawl the pages to assert the context. Then I need to resubmit the sitemap. And that’ll be all for today.

(readrss.php text source)
for the record, consider it GPL’ed (it ain’t exactly rocket science)

Categories
links, optimization, php
Tags
links, php, seo
Comments rss
Comments rss
Trackback
Trackback

« php link directory mod : page rank per page Spidering »

Leave a Reply

Click here to cancel reply.

Recent Posts

  • Pagerank sculpting session
  • wish you were here
  • interesting : seo panel
  • availability test
  • Mayday

click me!
rss
Comments rss
Blog Directory
Web Developement Blogs - BlogCatalog Blog Directory
Listed in LS Blogs the Blog Directory and Blog Search Engine
Blog Flux Directory
joopita.com free web directory and search engine
design by jide
sitemap
17242 confirmed spam kills