Created
October 10, 2012 01:12
-
-
Save kiyoto/3862549 to your computer and use it in GitHub Desktop.
anonymize/filter out timestamps from Adium chat logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# to parse Adium conversation | |
regex = /^[\d:]+ [AP]M (?<name>[^:]+): (?<msg>.*)$/ | |
for line in STDIN | |
m = regex.match(line) | |
next if not m | |
name = m['name'] | |
msg = m['msg'] | |
if not name or not msg | |
puts line | |
next | |
end | |
if name.downcase == 'kiyoto' | |
name = 'me ' | |
else | |
name = 'amigo' | |
end | |
puts "#{name}: #{msg}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment