PHP Script: Site Map with Number of Links Returned
Based on the CSV file, GWT and the content of the site establishes a hierarchical site map with the number of backlinks for each page.
The value that is considered is the second value of the table provided in Google Webmaster Tools: the number of links from different sites.
The pivot table, created by the script as an HTML file, allows you to assess the popularity of various types of pages on the site, depending on the number of links received.
Background:
- In
- the current configuration, the script requires a local site image if the script is not running on the server, in this case only a static site is required, that is, the pages are stored as HTML files.
- In addition, the site map is in standard XML format.
- PHP interpreter must be installed.
- Download the list of links back to your GWT account in CSV format.
The script itself does not require installation. After retrieving from the archive, to create a map, it starts with the command:
php backcount.php
If you have a site map file, the command:
php backmap.php
But you need to create a backcount.ini file to enter information about your site, which is in two lines:
site=c:/example.com map:sitemap.xml csv=www-example-com_20140530_ExternalLinks_LinkedPages.csv
The first line indicates the root of the page storage space. The second is the local path to the site map. These two commands are alternative, backcount uses only the site and backmap uses the map.
The third is the path and name of the csv file. You can add multiple cv strings to compare evolution over time.
If you need to manage multiple sites, you can create an ini file for each.
At startup, the program asks for the name of the ini file. You can then enter a name or press Enter directly if you are using the default backcount.ini file.
You can skip the .ini extension, the program will add it for you.
The program then creates an HTML table in the file with the first name from the CSV file name. Site directories are in bold and follow the list of files they contain. Each row on the right contains the number of references returned.
Reading this table will clearly show which part of the site is most popular and which is not interesting to anyone, it is much easier than with the original list, classified by the number of backlinks and not specifying pages without any backlinks.
They can be canceled to improve the site's rating in search results... Look why "Panda's Algorithm" is clear.
Simplified use
In the latest version of the script in August 2015, you no longer need to give a list of CSV files, provided that they are placed in the same directory as backcount.php.
Just specify a common prefix for CSV files in the ini file. For example, if your site is www.example.com, the common prefix would be: www-example-com:
site=c:/example.com prefix=www-example-com
Then follow the previous steps.
The backcount.zip archive contains Script source code and PHP executable code.
Versions
- August 21, 2015. New simplified version based on common prefix. The name of the HTML file to be created now consists of a prefix and a full date
- May 20, 2015. Updated to work with the latest PHP versions.
- November 9, 2014. References to directories were not counted. This is fixed .
- October 23, 2014. Adapts the source code for Script 2. Support for multiple CSVs with difference calculation. Shows the total number of backlinks in the HTML page and in the console.
- June 2014. First version.
The CSV format is often used to create lists that can be exchanged between different programs. The above script uses simple functions, because it is limited to well-defined files, but if you want to use this format in your programs with files of different origins, specialized tools can be useful:
- CSVfix. Allows you to classify the list alphabetically, search, convert to XML or SQL, compare two CSV files. Executable binary is available for Windows or Linux.
- Csvkit. Performs the same operations. Written in Python .
- OpenRefine. Unlike the previous ones, which work on the command line, it has a graphical interface. However, it does not work well on large files.