This module require weblinks module. It will fetch the Google Pagerank and Alexa Rank for evey link in Weblink. It will be updated everytime cron will be runned and will fetch latest data at that time.
If anyone wants something more or even updating this, can contact me. And i will made it to suite the requirement.

CommentFileSizeAuthor
#10 google_pagerank_notshowing.JPG90.23 KBsummit
pralexa.tar_.gz2.24 KBchia

Comments

nancydru’s picture

There are tons of coding standards violations here.

A URL column in the database should probably be a TEXT field because it can be very large.

nancydru’s picture

# user warning: Duplicate entry 'http://www.nowhere.de/' for key 1 query: INSERT INTO weblinks_pralexa VALUES ('http://www.nowhere.de/','4\n','255109') in C:\www\webapps\drupal-6\sites\all\modules\pralexa\pralexa.module on line 119.
# user warning: Duplicate entry 'http://www.example.com' for key 1 query: INSERT INTO weblinks_pralexa VALUES ('http://www.example.com','7\n','24466') in C:\www\webapps\drupal-6\sites\all\modules\pralexa\pralexa.module on line 119.
# user warning: Duplicate entry 'http://nobody.com' for key 1 query: INSERT INTO weblinks_pralexa VALUES ('http://nobody.com','','3958140') in C:\www\webapps\drupal-6\sites\all\modules\pralexa\pralexa.module on line 119.

and lots more

This apparently is caused by not allowing for node revisions.

nancydru’s picture

Status: Active » Needs work

I might suggest perhaps a collapsed fieldset at the top or bottom (maybe Help) that gives a brief explanation of the ranks.

nancydru’s picture

I fixed most of the above and it has been committed.

Changes I made:

  1. Settings page for how many rows per page (and others in the future).
  2. Pralexa page uses pager.
  3. Pralexa page uses tablesort.
  4. Coding standards compliant.
  5. Fixed the duplicate keys problem by going through the node table.
  6. Uses TRUNCATE to clear the table rather than individual DELETEs.
  7. Changed the schema: "url" is TEXT; "pagerank" and "alexa" are integers (for tablesort); added "groups."
  8. Pagerank and Alexa columns are right aligned.
  9. Added a "groups" column, with "unclassified" check.

To consider:

  1. The help about rankings.
  2. A cron limit to avoid timeouts.
  3. Changing collation so primary key can use more of url.
  4. Add check for published.
  5. Move to Weblinks page as a link at top.
chia’s picture

I appreciate your concern. I am correcting the errors and help in improving the module.

nancydru’s picture

I made the changes listed above and committed this add-on; it is already part of the -dev release. I left this open in case you wish to submit patches to deal with the things I listed in "To consider." If it matters, IMHO, the order I have listed is what I consider the order of importance. I suspect that #2 would involve moving the ranking fields directly into the weblinks table and needs to be discussed with rmiddle as he is the owner of this module.

nancydru’s picture

Status: Needs work » Fixed

I have solved all of the things to "Consider" above. If you have previously installed this module, you must uninstall it completely and re-install.

chia’s picture

I have done some of these tasks but you have submitted them before. I am now using that module that you have submitted and will add some more features to that.

nancydru’s picture

I imagine it's hard to recognize what you submitted. I look forward to your changes.

summit’s picture

StatusFileSize
new90.23 KB

Hi Nancy,

I tested this submodule, but it doesn't do anything.
I also run cron manually.
See attached picture. Do I have to do somewhere a setting to get this information?

Thanks a lot in advance for going into this!.
greetings,
Martijn

nancydru’s picture

You have to run Cron the get the rankings.

summit’s picture

Hi Nancy,
Thanks for your quick reply!
I did run Cron, but no rankings until now.

I also see a link to the page I am on just above the page. This link is not having any clear function I think.
See: http://www.aanbiedingen-herfstvakantie.nl/pralexa and see the link just below
"Google's page ranks run from 0 to 10; higher is better. Alexa's traffic rank has no limit; higher is better"

greetings,
Martijn

nancydru’s picture

Please check your "Recent log entries" (admin/reports/dblog) and see if it says it collected any. Also please let me know what your settings are. Also, are you sure these sites have been submitted to be ranked?

I did notice that I need to work on the help and menu a bit. I am committing a change for that.

nancydru’s picture

Title: I am attaching my custom module. This will have get the Google Pagerank and Alexa Rank for every link in weblinks using cron. » Google Pagerank and Alexa Rank for every link in weblinks using cron.

shortened title

summit’s picture

Hi Nancy,

With your remark: "Also, are you sure these sites have been submitted to be ranked?". Do you mean do they have a pagerank? Yes they have, or do I submit them somewhere specific?
Greetings,
Martijn

nancydru’s picture

Most search engines, including Google, may or may not find your site eventually. The surest way to make sure they do is to submit the URL directly to the search engine, or use one of the submission services.

The "Recent log" should show you if the module is indeed processing the links. You might also need to check your Apache logs. It is possible that you will need a firewall or proxy change to allow the Cron code to go to the Google and Alexa sites to retrieve the rankings. I would hope that this warning would be recorded in at least one of the logs.

summit’s picture

Hi Nancy,
Installed the latest dev. 3-march.

The websites shown in the example on http://www.aanbiedingen-herfstvakantie.nl/pralexa
- http://www.reizen-en-uitjes.nl/ has PR3 and
- http://www.bremerberg.nl/ has also PR3.
So they should be shown on the pagerank page, right?

The Recent log doesn't show any items related to pagerank and I set the cron set to 0 sec, and manually triggered cron. No chocolate.
See http://www.aanbiedingen-herfstvakantie.nl/pralexa

Thanks for going into this again, and sorry to be such a pain, and may be I do something wrong..

Greetings,
Martijn

nancydru’s picture

I added your bremerberg link and ran cron and yes, it shows rankings. You didn't say how many it was supposed to check (this should not be zero). Have you checked your Apache logs?

nancydru’s picture

If there is nothing in the log, then it is not running the Cron code. Even if there were no links checked, it should say that 0 links were checked.

summit’s picture

Hi Nancy,

I will look at the apache log this evening. Keep you posted!
EDIT: No Apache log entries about pagerankinge, and no watchdog entries...sorry. Don't know what else it can be...

greetings,
Martijn

nancydru’s picture

They would say Pralexa.

I'm out of ideas. Perhaps the original author, jasonleon, can comment.

rmiddle’s picture

Make the following change and try this.

Thanks
Robert

function pralexa_cron() {
$now = isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : time();
// Is it time to run again?
$last = variable_get('pralexa_cron_last', $now);
$interval = variable_get('pralexa_cron_interval', 86400);
if ($now - $last < $interval) {
// return; <-- Change this line.
}

$how_many = variable_get('pralexa_links_per_cron', 20);

chia’s picture

About this module there are few things that i want you to tell. I thought you all should pass that as most of us can.
First this code will not run if you are under a strong firewall.

1 more things you should edit this line
$xml = simplexml_load_file($request_url) or die("");
and change it to $xml = simplexml_load_file($request_url);
That die should be removed. Its the reason for blank screen. Because some server due to strong proxy settings dont allow simplexml_load_file command to be executed. If its not executed then the whole code will fail.

Because if its not able to collect the data from there then it will fail showing a blank screen.

http://data.alexa.com/data?cli=10&dat=snbamz&url=".$url
From this link the alexa rank is fetched where $url is the site name.

I will add additional features to NancyDru existing code, when i will get sometime.

Jasonleon

chia’s picture

Try removing die as i suggest if you get a error or a warning like this.

Warning: simplexml_load_file(http://data.alexa.com/data?cli=10&dat=snbamz&url=www.yoursite.com) [function.simplexml-load-file]: failed to open stream:

Then you are in a proxy or firewall in your work setup is blocking attempts - that might cause a connection refused error.

You can be behind a firewall or ISA, could this be true?

chia’s picture

nancydru’s picture

I committed a change removing the "die".

summit’s picture

Hi Nancy,

Something in the latest commit did it! I now see the pageranks!
Thanks a lot for your persistence!
Greetings,
Martijn

nancydru’s picture

Fabulous! Thanks for the update.

nancydru’s picture

Status: Fixed » Closed (fixed)

Included in 6.x-1.4.

summit’s picture

Version: 6.x-1.3 » 6.x-2.x-dev

Hi Nancy,
Should this feature be working on version 2?
Greetings, Martijn

nancydru’s picture

It is working for me.

summit’s picture

oeps, than I have to look into it more, it is not working for me using latest 2.dev weblinks.
greetings, Martijn

nancydru’s picture

Robert is having trouble too, please open a new issue.

nancydru’s picture

greywolfsspirit’s picture

I run poormanscron, as I am under windows.. I can't get the cron to work for me. However, poormanscron is still not polling the google rankings..

Could someone PLEASE write up a step by step install documentation..