sxiii

Firefox Bookmarks Import From Text File (make HTML from TXT)

Jun 10th, 2014
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.43 KB | None | 0 0
  1. #!/bin/bash
  2. # # # WHAT IS IT? # # #
  3. # This script converts plain-text URL links (each link started from new line)
  4. # into links that you can select and open in new tabs in firefox to import them
  5. # as bookmarks or open in tabs. This method is useful when coming from another browser
  6. # such as opera, safari, IE, etc. and if you used sqlite manager to get the URLs list but
  7. # can't import them into firefox (or another browser) directly.
  8. # # # HOW TO USE? # # #
  9. # Save links into file bookmarks.txt. Save script into somescript.sh in same dir.
  10. # Run script. It will create bookmarks.html. Now, to import created HTML file,
  11. # add (install) plugin "multi links" to firefox, open created bookmarks.html file
  12. # with firefox, press AND HOLD RIGHT MOUSE BUTTON (you can change it in plugin settings),
  13. # select all links, press the left mouse button on links and choose "Add to bookmarts"
  14. # or "Open in new tabs" etc. Have fun! // By Security XIII, 10.06.2014
  15. # # # SCRIPT STARTS HERE # # #
  16. # Specify file to import (TXT, each URL started from/by new line).
  17. infile=bookmarks.txt
  18. # Specify the resulting file (HTML).
  19. outfile=bookmarks.html
  20. # Counter
  21. count=0
  22. echo "Starting converting TXT file $infile to HTML file $outfile..."
  23. for url in $(cat $infile); do
  24. echo "<a href=$url>$url</a>" >> $outfile
  25. echo "<BR>" >> $outfile
  26. ((count++))
  27. done
  28. echo "Done converting TXT file $infile to HTML file $outfile, there was $count records converted. Thanks."
Advertisement
Add Comment
Please, Sign In to add comment