PHP Script: Sitemap with the number of backlinks

Establishes a map with directories of the site with the number of backlinks for each page.

Works with a CSV file from Google Search Console. For each URL on your site, it displays the number of backlinks and the number from different sites.
Only URLs with at least one backlink are displayed.

The table that the script produces as an HTML file, then allows to judge the popularity of different types of pages on your site, according to the number of links they receive.

Prerequisites:

The script itself requires no installation. Once extracted from the archive, to build a map from the files, it starts with the command:

php backcount.php

To use a preexisting map, the command is:

php backmap.php 

But you must create a backcount.ini file to enter information about your site, it must contain two lines, for example:

site=c:/example.com
map:sitemap.xml
csv=www-example-com_20140530_ExternalLinks_LinkedPages.csv

The first line indicates the path and name of the csv file.
The second the name of the generated file.

The first is mandatory. If the second is omitted, the name of the ini file will be used with an HTML extension for the name of the file to generate.

If you have multiple sites to manage, you can create an ini file for each one.

The program then generates an HTML table into a file whose name is made from the first part of the name of the CSV file. Directories of your site are in bold and are followed by the list of pages they contain. On each line on the right is the number of backlinks.

Reading this table will indicate clearly which part of the site is the most popular, and which nobody cares.
Pages not listed should either be deleted if the content is not original or de-indexed to improve your site's ranking in search results ... see why in The Panda algorithm made simple.

The archive backcount.zip contains the source code in the Scriptol language and the executable code in PHP.

Versions:

The CSV format is often used to produce lists exchangeable between different software. The script above uses simple functions because it is limited to a defined file, but if you want to use this format in your programs with files from different origins, a specialized tool may be useful :