Skip to content

Instantly share code, notes, and snippets.

View robsalasco's full-sized avatar
🏠
Working from home

Roberto Salas robsalasco

🏠
Working from home
View GitHub Profile
@robsalasco
robsalasco / streamschile
Last active August 29, 2015 14:00
TV Streams Chile
rtmp://wow2.cl.digitalproserver.com/redtv/redtvvivo/livestream1 pageUrl="http://www.lared.cl/online/" swfUrl="http://media.digitalproserver.com/v2/jw/6.7/jwplayer.flash.swf?v=67"
rtmp://chv.live.ztreaming.com:80/chvapp2/streamchv pageUrl="http://www.chilevision.cl/noticias/site/edic/base/port/senal_online.html" swfUrl="http://www.chilevision.cl/jwplayer/jwplayer.flash.swf"
rtmp://megatandas.ztreaming.com:80/megatandas/stream01megatandas04032013.sdp pageUrl="http://www.mega.cl/senal-en-vivo/" swfUrl="http://www.mega.cl/website/js/flowplayer/3.2.2/swf/player.swf"
rtmp://200.83.3.28:80/CNN-CHILE/CNN-CHILE
rtmp://13.cluster8.live.ztreaming.com:80/13hd/streamgrpz13hd pageUrl="http://envivo.13.cl/13.php" swfUrl="http://envivo.13.cl/forever/swf/flowplayer.commercial-3.2.7.swf" live=1
rtmp://190.96.94.214:80/13c/grpz13c pageUrl="http://envivo.13.cl/" swfUrl="http://envivo.13.cl/streaming.swf"
rtmp://wow2.cl.digitalproserver.com/ucvtv/_definst_/livestream1 pageUrl="http://www.ucvtv.cl/online.php" swfUrl="http://dps.vo
@robsalasco
robsalasco / lun.rb
Last active August 29, 2015 14:02
Las Ultimas Noticias (lun.com) - swf to pdf converter
require 'open-uri'
time = Time.now.strftime("%Y-%m-%d")
match = open("http://www.lun.com/pages/LUNHomepage.aspx?BodyID=0&dt=" + time).read.scan(/(http\:\/\/images\.lun\.com\/luncontents\/NewsPaperPages\/.*\.swf)/).flatten
puts "Creando directorio temporal de descarga"
FileUtils.mkdir("/tmp/lun/")
match.each do |entry|
open("/tmp/lun/" + File.basename(entry), "wb") do |file|
@robsalasco
robsalasco / latercera.rb
Last active August 29, 2015 14:02
La Tercera
require 'open-uri'
require 'net/http'
require 'fileutils.rb'
fecha = Time.now.strftime("%Y/%m/%d")
def remote_file_exists?(url)
url = URI.parse(url)
Net::HTTP.start(url.host, url.port) do |http|
return http.head(url.request_uri).code == "200"
@robsalasco
robsalasco / lacuarta.rb
Last active August 29, 2015 14:02
La Cuarta
require 'open-uri'
require 'net/http'
require 'fileutils.rb'
fecha = (Time.now - (60*60*24)).strftime("%Y/%m/%d")
def remote_file_exists?(url)
url = URI.parse(url)
Net::HTTP.start(url.host, url.port) do |http|
return http.head(url.request_uri).code == "200"
@robsalasco
robsalasco / elmercurio.rb
Created June 24, 2014 21:16
El Mercurio
require 'open-uri'
require 'fileutils.rb'
cuerpo = {"Cuerpo A" => 1, "Cuerpo B" => 2, "Cuerpo C" => 3, "Cuerpo D" => 4, "Cuerpo E" => 5, "Cuerpo F" => 6}
def cuerpodown(cuerpo)
time = Time.now.strftime("%Y-%m-%d")
match = open("http://impresa.elmercurio.com/pages/LUNHomepage.aspx?BodyID=" + cuerpo + "&dt=" + time + "&dtB=" + time + "&dtB=" + time).read.scan(/(http\:\/\/images\.elmercurio\.com\/MerServerContents\/NewsPaperPages\/.*\.swf)/).flatten
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Quake2 < Formula
desc "Quake 2"
homepage "https://github.com/yquake2/yquake2"
head "https://github.com/yquake2/yquake2.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "sdl"
@robsalasco
robsalasco / Transantiago public endpoints.md
Created July 12, 2017 19:00 — forked from radutzan/Transantiago public endpoints.md
APIs REST públicas con data del Transantiago. Respuestas en JSON.

Importante

Transantiago implementó estas APIs para uso interno, por lo que no hay ninguna garantía sobre su funcionalidad, mantenimiento o futura existencia. Úsalas bajo tu propio riesgo. (Probablemente no es aconsejable que las uses para nada crítico.)

Paraderos alrededor de un punto

http://www.transantiago.cl/restservice/rest/getpuntoparada?lat=-33.6089714&lon=-70.5742975&bip=1

Estimación de parada

http://www.transantiago.cl/predictor/prediccion?codsimt=PA420&codser=504 (código de servicio es opcional, pero el parámetro debe estar presente aunque esté vacío)

Lista de servicios

library(readr)
library(dplyr)
library(stringr)
library(sp)
library(rgdal)
library(rgeos)
library(spatialEco)
##%######################################################%##
# #
library(rvest)
library(stringr)
html <- read_html("http://www.asof.cl/apps/mapaferias/rm.php")
urls <- html %>% html_nodes("option") %>% html_attr("value") %>% na.omit()
maps <- sapply(urls, function(x) {
read_html(paste0("http://www.asof.cl/apps/mapaferias/",x)) %>%