Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 119 | All time: 9,519 This week: 455 |
Version | License | PHP version | Categories | |||
bookmarks-checker 1.0.0 | GNU General Publi... | 5 | HTTP, PHP 5, Files and Folders, Valid... |
The best PHP chrome bookmarks import to MySQL database class
Export bookmarks to HTML, parse the HTML, and import into MySQL
#!/usr/bin/env php |
So many browser bookmarks – there are 1,900 URLs in my bookmarks. And in just one year, 120 of those URLs ceased to exist.
A simple PHP prototype script provided a slow way (~1 URL per second) of checking for dead links.
I switched to Python to leverage its threading capabilities and speed up the process. Then I finally got round to adding cURL multi to the PHP script.
$ php bookmarks_checker.php
1883 links being checked ...
error | https://www.nxytimes.com/ | 0 | 4.999007 | nxytimes
<...>
See generated logfile bookmarks_checker.log
URL parse time: 177.642 s
95 links failed
1788 links verified
The scripts by default will attempt to load a file in the same directory called bookmarks.html An alternative filename can be specified on the command-line.
The scripts parse the file and try to access each URL, printing a list of URLs that cannot be accessed (which will intermittently include a false positive).
python3 bookmarks_checker.py
python bookmarks_checker_py2.py
(or make the file executable and run directly e.g. ./bookmarks_checker.py
)
-h
or --help
displays help text.
-f <file>
allows an alternatively-named file to be loaded instead of the default bookmarks.html
php bookmarks_checker.php [file]
Bookmarks > Show All Bookmarks > Import and Backup > Export Bookmarks to HTML
Access Chrome's Bookmark Manager with:
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd>
or
chrome://bookmarks/
then click Organize > Export bookmarks to HTML file ...
Setting DEBUG = True
will show all URLs as access is attempted, and either the successful response or the failure error message.
Doug Hellmann, jfs, and philshem for threading pools in Python.
Scripts are released under the GPL v.3.
Files (9) |
File | Role | Description | ||
---|---|---|---|---|
classes (1 file) | ||||
bookmarks.html | Doc. | Documentation | ||
bookmarks_checker.php | Example | Example script | ||
bookmarks_checker.py | Data | Auxiliary data | ||
bookmarks_checker_prototype.php | Aux. | Auxiliary script | ||
bookmarks_checker_py2.py | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation | ||
speed_example.txt | Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.