Open Pagerank 4

Remember the days when everyone-and-their-grandma had one of these little tickers on the site proudly displaying their Pagerank ?

I was on some domain-metrics site and noticed they listed a PageRank. That surprised me. PageRank is not updated and published by Google anymore (such a shame). But apparently we now have Open Pagerank by domcop.com. They got an enormous amount of data by Common Crawl and Common Search, and based on that data, they calculate a new Pagerank.  They claim they update it every three months, but the last update is from may 2018. Be industrious. For now, they only calculated PR for domains, they plan to also provide PR for urls.

They also have very simple API. They provide a PHP example, but the example doesn’t work for me, I added

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

…and then it worked like a charm. Probably some minor issue with the SSL-certificate or something.

This site gets pagerank 4 (3.93). Thank you, you are very kind. I rank at about 6.5 million. Yoast.com are doing a lot better, PR 6, and ranking around 19500.

We’ll see.

 

 

 

 

QuickGlossary wordpress plugin

I am curious with the ongoing discussion on LSI in search, how Googlebot responds to using the Datalist and it’s DFN definition element on page. Maybe it helps if we provide the search engines with more on page context. So I built a Quick Glossary WordPress plugin. It puts the single post tags with description as a Glossary in the sidebar and uses jQuery to shorten the displayed text and add a [more] link, so visitors can choose to read a full description but it does not dominate the page, whilst Googlebot and Slurp get the full context of the content according to my tag definitions.

PIYF
Acronym : Panda Is Your Friend

First the basic widget code, I’ll call it Quick Glossary :

function widget_QuickGlossary($args) {
        extract($args);

        //preparation : scope, css, javascript 

        echo $before_widget;
        echo $before_title . 'Quick Glossary' . $after_title; 

        //output  

        echo $after_widget;
}

register_sidebar_widget('Quick Glossary', 'widget_QuickGlossary');

the preparation

scope

I want my widget to only show on single posts, and only if the post has tags :

    if(!is_single()) return
    global $post;
    $tags = get_the_tags($post->ID);
    if(!$tags) return;

layout

I want a double column layout with the term (tag) linking to the tag page, and the definition itself only part visible, with a fancy [more] link like on Facebook.

First some css for a double column data list :


and then some jQuery : I want the whole definition on the page but only part visible to the reader. Viralpatel list a nice cut and paste jQuery snippet. That requires I add a class “more” to the DD element, and add some css for it and for the link :


I put the extra CSS script in it’s own function :

function quickGlossary_scripts() {
//css for doyble column
//css hooks for jquery
}

…and make sur the jquery script only loads when thr query is loaded :

add_action('init', 'register_QuickGlossary_script');
add_action('wp_footer', 'print_QuickGlossary_script');

function register_QuickGlossary_script() {
	wp_register_script('QuickGlossary', plugins_url('QuickGlossary.js', __FILE__), array('jquery'), '1.0', true);
}

function print_QuickGlossary_script() {
	global $add_QuickGlossary_script;
 	if ( ! $add_QuickGlossary_script ) return;
 	wp_print_scripts('QuickGlossary');
}

//nb.: requires setting the global var to true in the widget function
...
    global $add_QuickGlossary_script;
    $add_QuickGlossary_script = true;
...

…and proceed to generating the output, the data list :

the output

Straight forward, using DL as list container, tagname and description as list of DT DD elements, with an added class=”more” to the DD description as hook for jQuery.

function QuickGlossary_datalist($tags) {
   $html = '
';
   return $html;
}

You can edit your tag description under Admin-Posts-Post Tags menu.

Now my main widget function is :

function widget_QuickGlossary($args) {
    extract($args);

    if(!is_single()) return;

    global $post;
    $tags = get_the_tags($post->ID);
    if(!$tags) return;

    global $add_QuickGlossary_script;
    $add_QuickGlossary_script = true;

    quickGlossary_scripts();

    echo $before_widget;
    echo $before_title . 'Glossary' . $after_title; 

    echo QuickGlossary_datalist($tags);

    echo $after_widget;
}

Activate the widget, drag and drop it from Admin-Appearance-Widgets menu and it is a Quick Glossary, if you want to play with it, code is overhere as zip.

google suggest scraper (php & simplexml)

Today’s goal is a basic php Google Suggest scraper because I wanted traffic data and keywords for free.

Before we start :

google scraping is bad !

Good People use the Google Adwords API : 25 cents for 1000 units, 15++ units for keyword suggestion so they pay 4 or 5 dollar for 1000 keyword suggestions (if they can find a good programmer which also costs a few dollars). Or they opt for SemRush (also my preference), KeywordSpy, Spyfu, and other services like 7Search PPC programs to get keyword and traffic data and data on their competitors but these also charge about 80 dollars per month for a limited account up to a few hundred per month for seo companies. Good people pay plenty.

We tiny grey webmice of marketing however just want a few estimates, at low or better no cost : like this :

data num queries
google suggest 57800000
google suggestion box 5390000
google suggest api 5030000
google suggestion tool 3670000
google suggest a site 72700000
google suggested users 57000000
google suggestions funny 37400000
google suggest scraper 62800
google suggestions not working 87100000
google suggested user list 254000000

Suggestion autocomplete is AJAX, it outputs XML :

< ?xml version="1.0"? >
   <toplevel>
     <CompleteSuggestion>
       <suggestion data="senior quotes"/>
       <num_queries int="30000000"/>
     </CompleteSuggestion>
     <CompleteSuggestion>
       <suggestion data="senior skip day lyrics"/>
       <num_queries int="441000"/>
     </CompleteSuggestion>
   </toplevel>

Using SimpleXML, the PHP routine is as simple as querying g00gle.c0m/complete/search?, grabbing the autocomplete xml, and extracting the attribute data :

 
        if ($_SERVER['QUERY_STRING']=='') die('enter a query like http://host/filename.php?query');
	$contentstring = @file_get_contents("http://g00gle.c0m/complete/search?output=toolbar&q=".urlencode($kw));  
  	$content = simplexml_load_string($contentstring );

        foreach($content->CompleteSuggestion as $c) {
            $term = (string) $c->suggestion->attributes()->data;
            //note : traffic data is sometimes missing   
            $traffic = (string) $c->num_queries->attributes()->int;
            echo $term. " ".$traffic . "
" ;
	}

I made a quick php script that outputs the terms as a list of new queries so you can walk through the suggestions :

The source is as text file up for download overhere (rename it to suggestit.php and it should run on any server with php5.* and simplexml).