Project

linodians

0.0
No release in over 3 years
Low commit activity in last 3 years
Library for viewing public Linode employee data
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.1.1
~> 2.3.0
~> 0.4.0
~> 12.3.0
~> 3.7.0
~> 0.54.0
~> 4.0.0
~> 3.3.0

Runtime

~> 1.0.0
~> 1.8.0
 Project Readme

linodians

Gem Version Build Status Coverage Status Code Quality MIT Licensed

Library for viewing public Linode employee data

Usage

From the command line

A linodians script is provided that will output the current data:

❯ linodians -h
Usage: linodians [-v] [-j]
    -j, --json                       Output as json
    -v, --version                    Show version

Running just linodians will print a human-readable list. For consumption by other tools, linodians -j will output JSON.

From Ruby code

First, create a Linodian object

require 'linodians'
employees = Linodians.new

You now have an array of all publically listed Linodians. The following attributes are provided:

  • fullname: Full name as publicized
  • username: Short name as publicized
  • title: Their position

Any social sites are also parsed, if provided, including 'twitter', 'linkedin', and 'github'.

A .photo method is also provided that pulls their public photo.

For example, if you want to follow all the Linodians on Twitter, you can quickly grab all available Twitter profiles:

require 'linodians'
employees = Linodians.new
twitter_profiles = employees.map { |x| x[:twitter] }.compact
puts twitter_profiles

Say you want to follow any of them you don't already follow? You can combine the above with sferik's awesome "t" CLI for Twitter:

linodian_accounts = twitter_profiles.map { |x| x.split('/').last }
currently_following = `t followings`.split
new_accounts = linodian_accounts.reject { |x| currently_following.include? x }
new_accounts.each { |x| system "t follow #{x}" }

Or you can find all the listed titles and how many people have each title:

require 'linodians'
employees = Linodians.new
titles = employees.map(&:title).each_with_object(Hash.new(0)) { |i, o| o[i] += 1 }
titles.sort_by(&:last).each { |title, count| puts "#{count} -- #{title}" }

A helper ".lookup" method is provided on top of Array's usual tools, and it is a shortcut for find { |x| x.username == username }. As such, you can use it to look somebody up by their username:

employees = Linodians.new
my_friend = employees.lookup('caker')

Loading in existing data

If you already have a hash of data, like one created with Linodians.new.to_json, you can import it back in when making a new Linodians object:

require 'linodians'
require 'json'

data = File.open('data.json') { |fh| JSON.parse fh }
employees = Linodians.new(data)

Installation

gem install linodians

License

linodians is released under the MIT License. See the bundled LICENSE file for details.