Skip to content

peterc/webloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webloc

webloc is a Ruby library that can read from and write to .webloc files as used on macOS. These are a variant of 'plist' format files, specifically used for storing links to URLs.

It works on Ruby 2.7 and up, including Ruby 3.x, and supports URLs of up to 2048 characters in length (and probably longer, but this is around the de facto limit for URLs in most systems).

Installation

gem install webloc

Usage

Reading a .webloc file:

Webloc.load(ARGV.first).url

Writing to a .webloc file:

Webloc.new('https://rubyweekly.com/').save('rubyweekly.webloc')

Thanks

Thanks is due to Christos Karaiskos for this article which helped me understand the plist format a bit more when fixing a bug in 2024.

License

Copyright (C) 2011-2024 Peter Cooper

webloc is licensed under the terms of the MIT License

About

Read and write .webloc (web link) files on macOS / OS X

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages