summaryrefslogtreecommitdiff
blob: 72de77d444fd8d9831ee7854ea3106840158fc48 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/ruby -w

require 'open-uri'
require 'pp'

module PlanetIniParser

    def PlanetIniParser.updateDevs(developers)
        planetUri = "http://sources.gentoo.org/viewcvs.py/*checkout*/planet/configs/planet.ini"
        open(planetUri) do |file|
            while line = file.gets do
                if line =~ /^\[(.*)\]$/ 
                    url = $1
                    next if url == "Planet" or url == "DEFAULT"
        
                    data = {}
                    while line = file.gets do
                        line.chomp!
                        break if line == ""
                        line =~ /(.*) = (.*)/
                        data[$1] = $2
                    end

                    developer = developers["#{data['username']}@gentoo.org"]
                    unless developer.nil?
                        unless data['face'].nil?
                            developer.hackergotchi = "http://planet.gentoo.org/images/#{data['face']}"
                        end

                        developer.blogRss = url
                    end
                end
            end
        end
        
    end

#    def PlanetIniParser.updateDev(developer)
#        planetUri = "http://sources.gentoo.org/viewcvs.py/*checkout*/planet/configs/planet.ini?rev=176"
#        open(planetUri) do |file|
#            while line = file.gets do
#                if line =~ /^\[(.*)\]$/ 
#                    url = $1
#                    next if url == "Planet" or url == "DEFAULT"
#        
#                    data = {}
#                    while line = file.gets do
#                        line.chomp!
#                        break if line == ""
#                        line =~ /(.*) = (.*)/
#                        data[$1] = $2
#                    end
#
#                    if data['username'] == developer.handle
#                        if ! data['face'].nil?
#                            developer.hackergotchi = "http://planet.gentoo.org/images/#{data['face']}"
#                        end
#                        developer.blogRss = url
#                    end
#            end
#        end
#    end

end