Bienvenido a Tecnohackers

Tecnohackers » Programacion » Area de Programacion » Scripting. VBS, Batch, Bash, JavaSript.
 » 

[Ruby] Buscador de sueños 0.1



Autor Tema: [Ruby] Buscador de sueños 0.1  (Leído 708 veces)

Desconectado Doddy

  • Veterano
  • ***
  • Mensajes: 249
  • Slow Mind
[Ruby] Buscador de sueños 0.1
« en: Abril 04, 2012, 06:34:07 pm »
Un buscador de sueños en Ruby

Código: You are not allowed to view links. Register or Login
#!usr/bin/ruby
#Buscador de sueños 0.1
#Coded By Doddy H

require "net/http"

def head()
  print "\n\n-- == Buscador de sueños == --\n\n"
end

def copyright()
  print "\n\n(C) Doddy Hackman 2012\n\n"
  gets.chomp
  exit(1)
end

def toma(web)
  return Net::HTTP.get_response(URI.parse(web)).body
end

head()

print "\n[+] Texto : "
string = gets.chomp

url = "http://www.mis-suenos.org/interpretaciones/buscar?text="+string

code = toma(url)

if code=~/<li>(.*)<\/li>/
  text = $1
  if text == " "
    print "\n\n[-] No encontrado"
  else
    print "\n\n[+] Significado : "+text
  end
end

copyright()

#The End ?
You are not allowed to view links. Register or Login

Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal