PingCrawl Mod - uses META Keys or TITLE

Status
Not open for further replies.

bufuscout

New member
May 27, 2008
10
0
0
I didn't want to use the PingCrawl plug-in because it only uses the TAGs as search terms. I decided to man up and look through the code to find a way to make it work for me.

It's working for me, and once I find time, I plan on extending the PingCrawl interface and add an option for more RSS feeds to crawl.

It's attached as a TXT file, so just rename it and upload it.

Here's the modifications:

1. Uses the permalink for the post, and not the GUID (so you're pingback links are friendly).
Code:
protected function doPingback( $url , $blogu, $post ) {
    ...
    if(!$client->query( 'pingback.ping', get_permalink( $post->ID ), $bu )) {
    .......
}
2. No longer uses the TAGs of a post. It tries to use the META Key "pingcrawl". If it can't find it, it uses the Title. It then strips out extra characters from the title, just incase.
Code:
protected function savePost( $opost ) {
    .....
    $searchTerm = "";
    
    if ( get_post_meta( $opost->ID, "pingcrawl", true ) )
    $searchTerm = get_post_meta( $opost->ID, "pingcrawl", true );
    else
    $searchTerm = $opost->post_title;
    
    $excludeChars = array( "'", "+", "$", "!", ",", "-", "%", "&", "*", "(", ")", "=", "?" );
    $searchTermClean = str_replace( $excludeChars, "", $searchTerm );
    
    $rss = $this->getRss( $searchTermClean, $numberOfBlogsToGetFromGoogle );
    ......
}
I've tested it, and it works for me, using the meta key helps me target blogs better than the title does.
 

Attachments

  • wf_pingcrawl.txt
    6.9 KB · Views: 13


Nice - I was poking around this earlier and changed it from tags to title - I never use tags since I auto post just about everything :)
 
Bofu, I know this is you.
How is this better than the title pingcrawl?

And a question, if the meta tags are not seod, obviously this plugin does not work. Right?
 
Bofu, I know this is you.
How is this better than the title pingcrawl?

And a question, if the meta tags are not seod, obviously this plugin does not work. Right?

naw, its bufu. old nickname from highschool.

it's "better" because it lets you use a META Key and then DEFAULTS to a title. the title crawler had options for auto-blogging, with its "only pingcrawl 1 of every 5 posts" option.

this one isnt necessarily meant for autoblogging. i want to expand pingcrawl to have a user interface for blog-level defaults, and post-level settings, a re-crawl button, and have the crawls be integrated into the template of the page.
 
Status
Not open for further replies.