Skip to content

Instantly share code, notes, and snippets.

/fet.rb Secret

Created August 24, 2015 17:42
Show Gist options
  • Save anonymous/123137386b9fce2a64cd to your computer and use it in GitHub Desktop.
Save anonymous/123137386b9fce2a64cd to your computer and use it in GitHub Desktop.
## clearfix user_in_list
##https://fetlife.com/administrative_areas/2789/kinksters?page=
##
require 'open-uri'
require 'nokogiri'
require 'sequel'
require 'mysql2'
require 'mechanize'
require 'open-uri'
agent = Mechanize.new
agent.get('https://fetlife.com/login')
agent.page.form.nickname_or_email = "koko"
agent.page.form.password = "poop"
agent.page.form.submit
agent.page.link_with(:text => 'Porto').click
agent.page.link_with(:text => 'view more →').click
#parsy
parsy = agent.page.parser
parsy.at_css('.clearfix .user_in_list')
user = parsy.at_css('.clearfix .user_in_list a img')['alt']
age = parsy.at_css('.clearfix .user_in_list .span-8 .quiet').text.to_s.split(' ')[0].to_s.delete('^0-9')
sex = parsy.at_css('.clearfix .user_in_list .span-8 .quiet').text.to_s.split(' ')[0].to_s.delete('0-9')
url = parsy.at_css('.clearfix .user_in_list a')['href']
img = parsy.at_css('.clearfix .user_in_list img')['src']
type = parsy.at_css('.clearfix .user_in_list .span-8 .quiet').text.to_s.split(' ')[1].to_s
puts user
puts age
puts sex
puts url
puts img
puts type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment