Created
May 23, 2014 06:37
-
-
Save take-five/b0182d2fad1f2df0be67 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
./extract.sh | wc -l |
This file contains hidden or 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
#!/bin/bash | |
cat <(./facebook_messages.rb) <(./facebook_messages.rb) | | |
./split.rb | | |
./lowercase.rb | | |
egrep '.{2,}' | | |
sort | uniq | | |
./mystem -w -n -e utf-8 | | |
grep -v '??' | | |
sed -n -e '$!N' -e 's/\n//g' -e 's/.*{\([^{][^{]*\)}.*/\1/gp' | | |
awk -F\| '{ for (i = 0; ++i <= NF; )print $i }' | | |
sort | uniq |
This file contains hidden or 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 | |
require 'bundler/setup' | |
require 'nokogiri' | |
input = './facebook-amikhailov83/html/messages.htm' | |
doc = Nokogiri::HTML(open(input)) | |
doc.css('.message').each do |header| | |
author = header.css('.message_header span.user').first | |
if author.content == 'Алексей Михайлов' | |
message = header.next | |
puts message.content | |
end | |
end |
This file contains hidden or 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 | |
require 'bundler/setup' | |
require 'nokogiri' | |
input = './facebook-amikhailov83/html/wall.htm' | |
doc = Nokogiri::HTML(open(input)) | |
doc.css('.comment').each do |comment| | |
header = comment.previous.content | |
if header.include?('Алексей Михайлов') && !header.include?('posted something via') | |
puts comment.content | |
end | |
end |
This file contains hidden or 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
source 'https://rubygems.org' | |
gem 'nokogiri' | |
gem 'sanitize' | |
gem 'activesupport' |
This file contains hidden or 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 | |
# coding: utf-8 | |
require 'bundler/setup' | |
require 'active_support/core_ext/string/multibyte' | |
$stdin.each_line { |x| puts x.mb_chars.downcase } |
This file contains hidden or 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 | |
$stdin.each_line do |line| | |
line.scan(/([а-я]+)(-[а-я]+)?/i).each do |x| | |
puts x.join | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment