Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Mac OSX Terminal – Lynx HTML Parsing

Posted on January 1, 2018 By David Kittell

Lynx has a lot of good purposes but in this example below I’m simply going to strip URLs from a bookmarks HTML file exported from Chrome.

brew install lynx
lynx -dump -nonumbers -listonly bookmarks_11_18_16.html > links1.txt

If you have created folders and links all over the place in Chrome or Firefox this below will be helpful

lynx -dump -nonumbers -listonly bookmarks_11_18_16.html > links1.txt
lynx -dump -nonumbers -listonly bookmarks_11_23_16.html > links2.txt
cat links1.txt links2.txt > links3.txt && rm links1.txt links2.txt

awk '!seen[$0]++' links3.txt > linksclean.txt && rm links3.txt

sort linksclean.txt | uniq -u > linkscleanUnique.txt && rm linksclean.txt

while IFS= read -r line
do
echo "<DT><A HREF=\"$line\">$line</a></DT>"
done < linkscleanUnique.txt > linkslist.txt
cat header.txt linkslist.txt footer.txt > Clean_Bookmarks_$(date +%Y-%m-%d_%H.%M.%S).html
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code Mac OS X Shell Mac OSX UNIX UNIX Shell Scripts

Post navigation

Previous post
Next post

Related Posts

Ektron Framework API – List Folders

Posted on February 3, 2015October 26, 2015

I found this code on the Ektron Developer Center (see link below) that pertained mainly to menus but assisted me in getting a folder drill-down so I could add it into my DMS content widget. Similar to the DMS content widget make sure you setup the proper permissions to the…

Read More

Azure PowerShell – Get Static IP of Azure VMs

Posted on July 11, 2016

Get-AzureVM | Select-Object -Property Name, @{Name=’StaticIP’;Expression={(Get-AzureStaticVNetIP -VM $_ ).IPAddress}} All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what…

Read More

Proper Case Function

Posted on August 6, 2013October 26, 2015

This will convert a given string to proper case. create FUNCTION ProperCase ( –The string to be converted to proper case @input varchar(8000) ) –This function returns the proper case string of varchar type RETURNS varchar(8000) AS BEGIN IF @input IS NULL BEGIN –Just return NULL if input string is…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes