GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — scripts/meetups-attendees.rb at master · parisdevops/scripts

Expand file tree

/

meetups-attendees.rb

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
38 lines (31 loc) · 1.19 KB
/

meetups-attendees.rb

Copy path

File metadata and controls

executable file
·
38 lines (31 loc) · 1.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env ruby
# retrieve meetups attendees from lanyrd
# and print some stats
require 'rubygems'
require 'nokogiri'
require 'open-uri'
urls = []
urls << "http://lanyrd.com/2010/first-devops-meetup-paris/attendees/?page="
2.upto(7) do |i|
urls << "http://lanyrd.com/2011/paris-devops-meetup-#{i}/attendees/?page="
end
meetups = []
urls.each do |url|
attendees = []
page = 1
begin
doc = Nokogiri::HTML(open(url + page.to_s)) rescue nil
page+=1
attendees << doc.css('div.mini-profile span.name a[href]').map{|e| e['href'].gsub(/\/profile\/(.*)\//,'\1')} unless doc.nil?
end while not doc.nil?
meetups << attendees.flatten
end
people = {}
meetups.each{|m| m.each{|p| people[p].nil? ? people[p]=1 : people[p]+=1}}
people_by_participations = people.inject([]){|m,p| m[p[1]].nil? ? m[p[1]]=[p[0]] : m[p[1]]<<p[0] ; m}
puts "parisdevops meetups stats :"
puts "#{meetups.count} meetups"
puts "#{meetups.flatten.count} participations"
puts "#{people.count} participants"
puts "stats by number of participations :"
people_by_participations.each_with_index{|e,i| puts "#{i} participations : #{e.count rescue 0} people - #{(e.count rescue 0)*100/(people.count)}% (#{e.join(',') rescue ''})"}
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.