├── .gitattributes ├── .gitignore ├── LICENSE.md ├── README.md ├── assets └── css │ └── style.css ├── bookmarks.php ├── database └── table.sql ├── include └── connect.php ├── index.php └── load.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | assets/.DS_Store 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Nicolas Rollier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bookmarklet 2 | A simple to use bookmarklet for saving all your favorite URL's to a MySQL database. Only tested with Safari and Chrome browsers 3 | 4 | ## Installation 5 | Copy the files to your webserver. 6 | 7 | * Create a new MySQL database and import the schema you'll find in **database** directory : `table.sql` 8 | * Update the `connect.php` file in the **include** directory, to reflect your database configuration 9 | * Visit the `index.php` page, it will provide the necessary instructions to add the bookmarklet to your Favorites bar (Safari) or the Bookmarks bar (Chrome) depending on which browser you choose 10 | 11 | 12 | The following screenshot illustrates the message displayed when visiting `index.php`: 13 | 14 | ![Screenshot](https://raw.githubusercontent.com/nrollr/Bookmarklet/screenshot/images/screenshot%402px.png) 15 | 16 | Simply drag and drop the link using the icon in your Bookmarks bar. It will appear as `Bookmark!` 17 | 18 | ## Usage 19 | 20 | * Visit a website you wish to save to your local database 21 | * Click the `Bookmark!` link in your Bookmarks bar and you'll be redirected to the `load.php` page, which will display the `title` and `url` of the website you wish to add. Review and click Submit to add to the database. 22 | * Upon success, you'll be redirected once more, this time to `bookmarks.php` which lists all bookmarks you've added to the database so far.. 23 | 24 | ## License 25 | 26 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | .ui.message { 2 | border-radius: 0px; 3 | border-bottom: 1px solid rgba(34,36,38,.22); 4 | -webkit-box-shadow: none; 5 | -box-shadow: none; 6 | } -------------------------------------------------------------------------------- /bookmarks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 |

Bookmarks

15 |
16 |
17 | '; 24 | echo '
"'.$row['title'].'"
'; } 25 | 26 | mysqli_close($link); 27 | ?> 28 |
29 |
30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /database/table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `bookmarks` ( 2 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 3 | `hash` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 4 | `url` text COLLATE utf8_unicode_ci NOT NULL, 5 | `title` text COLLATE utf8_unicode_ci NOT NULL, 6 | `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 7 | PRIMARY KEY (`id`), 8 | UNIQUE KEY `hash` (`hash`) 9 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 10 | -------------------------------------------------------------------------------- /include/connect.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 19 |
20 | 21 | 22 | 27 | 28 | -------------------------------------------------------------------------------- /load.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 |
16 |
17 |

Save bookmark

18 |
19 |
20 | 21 | 22 |
23 |
24 | 25 | 26 |
27 | 28 |
29 |
30 | 31 | '; 40 | echo 'window.location.href="bookmarks.php";'; 41 | echo ''; 42 | } else{ 43 | echo '
'; 44 | echo "
Error !

". mysqli_error($link) ."

"; 45 | } 46 | mysqli_close($link); 47 | } ?> 48 |
49 |
50 | 51 | 52 | 57 | 58 | --------------------------------------------------------------------------------