Changeset 20341
- Timestamp:
- 09/28/07 22:03:52 (9 months ago)
- Files:
-
- link-harvest/trunk/README.txt (modified) (1 diff)
- link-harvest/trunk/link-harvest.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
link-harvest/trunk/README.txt
r8064 r20341 1 === Share This===1 === Link Harvest === 2 2 Tags: link, links, report, reporting, blogroll 3 3 Contributors: alexkingorg 4 4 Requires at least: 2.0 5 Tested up to: 2. 16 Stable tag: 1. 05 Tested up to: 2.3 6 Stable tag: 1.1 7 7 8 8 Link Harvest will go through all of your posts and pages and compile a list of all external links. Then it will create a live updating linkroll for you, based on your actual linking activity. link-harvest/trunk/link-harvest.php
r11745 r20341 5 5 Plugin URI: http://alexking.org/projects/wordpress 6 6 Description: This will harvest links from your WordPress database, creating a links list sorted by popularity. Once you have activated the plugin, you can configure the <a href="options-general.php?page=link-harvest.php">Settings</a> and see your <a href="index.php?page=link-harvest.php">list of links</a>. Also see <a href="options-general.php?page=link-harvest.php#aklh_template_tags">how to show the list of links</a> in your blog. Questions on configuration, etc.? Make sure to read the README. 7 Version: 1.1 b17 Version: 1.1 8 8 Author: Alex King 9 9 Author URI: http://alexking.org … … 248 248 foreach ($links[1] as $link) { 249 249 if (in_array(substr($link, 0, 7), array('http://', 'https:/')) && !$this->excluded_file_type($link)) { 250 $urls[] = $link;250 $urls[] = trim($link); 251 251 } 252 252 } … … 315 315 // FeedBurner hack, working around this: 316 316 // http://alexking.org/blog/2006/12/01/why-i-dont-use-feedburner 317 if (strstr($link, '/feeds.feedburner.com/') || strstr($link, '/~r/')) { 318 require_once(ABSPATH.WPINC.'/class-snoopy.php'); 319 $snoop = new Snoopy; 320 $snoop->maxlength = 2000; 321 $snoop->read_timeout = $this->timeout; 322 $snoop->fetch($link); 323 if (!empty($snoop->lastredirectaddr)) { 324 $link = $snoop->lastredirectaddr; 325 } 326 } 327 $domain = $this->get_domain($link); 328 if (!empty($domain)) { 329 foreach ($this->exclude as $exclude) { 330 if (strstr($domain, $exclude)) { 331 return; 317 if (!empty($link)) { 318 if (strstr($link, '/feeds.feedburner.com/') || strstr($link, '/~r/')) { 319 require_once(ABSPATH.WPINC.'/class-snoopy.php'); 320 $snoop = new Snoopy; 321 $snoop->maxlength = 2000; 322 $snoop->read_timeout = $this->timeout; 323 $snoop->fetch($link); 324 if (!empty($snoop->lastredirectaddr)) { 325 $link = $snoop->lastredirectaddr; 332 326 } 333 327 } 334 if (isset($domain_count[$domain])) { 335 $domain_count[$domain]++; 336 } 337 else { 338 $domains[] = $domain; 339 $domain_count[$domain] = 1; 340 } 341 $harvest[] = array($link, $domain); 342 } 343 344 aklh_log('Processed link: '.$link); 345 328 $domain = $this->get_domain($link); 329 if (!empty($domain)) { 330 foreach ($this->exclude as $exclude) { 331 if (strstr($domain, $exclude)) { 332 return; 333 } 334 } 335 if (isset($domain_count[$domain])) { 336 $domain_count[$domain]++; 337 } 338 else { 339 $domains[] = $domain; 340 $domain_count[$domain] = 1; 341 } 342 $harvest[] = array($link, $domain); 343 } 344 345 aklh_log('Processed link: '.$link); 346 347 } 348 else { 349 350 aklh_log('Skipped link: '.$link); 351 352 } 346 353 } 347 354 … … 1203 1210 ini_set('display_errors', '0'); 1204 1211 ini_set('error_reporting', E_PARSE); 1212 1213 @set_time_limit(999999999999999999999); 1214 1205 1215 $aklk = new ak_link_harvest; 1206 1216 $aklk->get_settings(); … … 1220 1230 $limit = $aklh->default_limit;; 1221 1231 } 1232 1233 if ($start == 0) { 1234 aklh_log("\n\n\n".'Starting a new harvest'."\n".'PHP Version is: '.phpversion()); 1235 $plugins = get_option('active_plugins'); 1236 if (is_array($plugins) && count($plugins) > 0) { 1237 foreach ($plugins as $plugin) { 1238 aklh_log('Active plugin: '.$plugin); 1239 } 1240 } 1241 } 1242 1243 aklh_log("\n".'Starting with offset "'.$start.'"'."\n"); 1244 1222 1245 $aklk->harvest_posts(null, $start, $limit); 1223 1246 $count = $wpdb->get_var(" … … 1238 1261 $completed = $count; 1239 1262 } 1263 1264 aklh_log('Returning "'.''.$completed.'"'."\n"); 1265 1240 1266 die(''.$completed); 1241 1267 break;
