
| 						 principal nivel superior enviar artículo buscar administrar acerca de ... rdf rss main  |   
  
  
		 			Posted by Gunnar on Friday November 02, @10:11AM el 2007from the hpricot-rules-your-w0rld dept. Reporte sencillito, a fin de cuentas - Agregué ya otro pedacín de funcionalidad. Cada dos horas, los tres sitios (TSG a las horas pares en punto, DSG a las horas pares+0:20 y ST a las horas pares+0:40) jalan el menú del sitio Drupal. Para quien quiera saberlo, ¿cómo lo hago? Con HPricot, una biblioteca preciosa de Ruby que sirve para parsear (y corregir, y mil cosas más) HTML/XML. Como muestra, ¿cómo encuentro sólo el div en cuestión? Facilito: ./script/runner 'require "hpricot"; require "open-uri"; puts Hpricot(open("http://www.icme11.org/")).search("div[@id=\"sidebar\"]").inner_html' El search me entrega un arreglo con todos los divs cuyo ID sea sidebar - Claro, sólo hay uno (pues en HTML, sólo debe haber un elemento con cada ID). Y ese, tal cual, lo trepo a la BD. HPricot es bonito. ¡Gracias, HPricot! < ICME 1.5 Alpha :-) | reporte > 
  |   
		
 
  |   
		||||||||||||||
  |   
||||||||||||||||
  
			  
                              
			 |   
		"Any system that depends on reliability is unreliable." -- Nogg's Postulate | |
| All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©1999 Butch Landingin. | ||