Last active
June 30, 2019 09:45
-
-
Save tian2992/4bb650879eb846716656 to your computer and use it in GitHub Desktop.
This file contains 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
# This is a comment | |
FROM opensuse:13.1 | |
MAINTAINER Sebastian Oliva <yo@sebastianoliva.com> | |
RUN zypper --non-interactive --gpg-auto-import-keys ref && zypper --non-interactive install python python-pip python-devel | |
RUN zypper --non-interactive install python-opencv python-mysql python-scipy |
This file contains 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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:f6c428c2ad756aa7ff3a32175c2e57ba6a828e0e3dda2b7aea5ad038b7e60724" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"import time\n", | |
"import requests\n", | |
"import xml.etree.ElementTree as ET" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 65 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"def get_stations_iter():\n", | |
" BASE_URL = \"http://opml.radiotime.com/Browse.ashx?c=local\"\n", | |
" local_response = requests.get(BASE_URL)\n", | |
" text_content = local_response.text\n", | |
" xml_response = ET.fromstring(text_content.encode(\"UTF-8\"))\n", | |
" body_tag = xml_response.find(\"body\").find(\"outline\")\n", | |
" all_stations = list(body_tag.getiterator(\"outline\"))\n", | |
" for station in all_stations:\n", | |
" if station.attrib.get(\"URL\"):\n", | |
" yield station" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 47 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"urls = [st.attrib.get(\"URL\") for st in get_stations_iter()]" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 55 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"urls" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"metadata": {}, | |
"output_type": "pyout", | |
"prompt_number": 56, | |
"text": [ | |
"['http://opml.radiotime.com/Tune.ashx?id=s231790',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s163510',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s137278',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s137983',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s50020',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s132897',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s155355',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s129795',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s123047',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s150684',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s149816',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s174012',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s151149',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s166343',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s9531',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s232295',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s129397',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s83417',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s161753',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s1256',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s164439',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s143867',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s163511',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s191805',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s50030',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s125289',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s129581',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s138009',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s119551',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s163513',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s184543',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s161300',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s83606',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s83608',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s132548',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s134981',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s210702',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s83620',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s187026',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s83622',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s13216',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s118220',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s163514',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s140376',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s130549',\n", | |
" 'http://opml.radiotime.com/Tune.ashx?id=s214588']" | |
] | |
} | |
], | |
"prompt_number": 56 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"def fetch_urls(url):\n", | |
" for u in urls:\n", | |
" time.sleep(1)\n", | |
" try:\n", | |
" yield requests.get(u).text\n", | |
" except:\n", | |
" pass" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 69 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"real_urls = list(fetch_urls(urls))" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 70 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"real_urls" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"metadata": {}, | |
"output_type": "pyout", | |
"prompt_number": 71, | |
"text": [ | |
"[u'http://96.127.183.74:8654\\n',\n", | |
" u'http://168.144.82.115:7250\\n',\n", | |
" u'http://edmenstudio.net:8069\\n',\n", | |
" u'http://panel2.directhostingcenter.com/tunein.php/zxgddufs/playlist.pls\\n',\n", | |
" u'http://www.grupoalius.com:8000/exafm\\n',\n", | |
" u'http://radiolatina.info:8759\\n',\n", | |
" u'http://91.121.134.23:8001/espresiv.mp3\\n',\n", | |
" u'http://176.31.132.102:7112\\n',\n", | |
" u'http://198.49.76.250:9193\\n',\n", | |
" u'http://radiolatina.info:9848\\n',\n", | |
" u'http://radiolatina.info:9846\\n',\n", | |
" u'http://radio.libertopolis.com:8000/live\\n',\n", | |
" u'http://streaming.crwarpaths1.info:8000/magica\\n',\n", | |
" u'http://giss.tv:8001/lametrofm.mp3\\nhttp://giss.tv:8000/lametrofm.mp3\\n',\n", | |
" u'http://st2.inkaniserver.net:8102\\n',\n", | |
" u'http://192.99.17.12:2050\\n',\n", | |
" u'http://srv5.icecaster.com:8000/radiofmamiga\\n',\n", | |
" u'http://108.178.57.196:11150\\n',\n", | |
" u'http://stream.serverinfinity.com:7054/\\n',\n", | |
" u'http://184.172.26.162:8040\\n',\n", | |
" u'http://radiolatina.info:8725\\n',\n", | |
" u'http://50.22.219.37:18779/\\n',\n", | |
" u'http://91.121.134.23:8000/radioatitlan.mp3\\n',\n", | |
" u'http://50.7.181.186:8072\\n',\n", | |
" u'http://199.201.89.29:7342/\\n',\n", | |
" u'http://76.164.217.100:7134/live\\n',\n", | |
" u'http://85.17.30.50/tunein.php/panamericana/playlist.pls\\n',\n", | |
" u'http://radioevangelica.com/plenitud.asx\\n',\n", | |
" u'http://www.grupoalius.com:8000/plus102\\n',\n", | |
" u'http://69.64.49.34:8010\\n',\n", | |
" u'http://206.190.135.28:8176\\n',\n", | |
" u'http://www.grupoalius.com:8000/radiopunto\\n',\n", | |
" u'http://srv5.icecaster.com:8000/radiofmritmo\\n',\n", | |
" u'http://192.99.34.205:8567\\n',\n", | |
" u'http://66.128.53.148:8024/\\n',\n", | |
" u'http://67.228.177.153:3533/Live\\n',\n", | |
" u'http://200.6.230.70:8000\\n',\n", | |
" u'http://85.17.30.50:8235\\n',\n", | |
" u'http://srv5.icecaster.com:8000/radiofmtropicana.m3u\\n',\n", | |
" u'http://dns921.no-ip.biz:8000\\n',\n", | |
" u'http://174.142.111.104:9962\\n',\n", | |
" u'http://www.grupoalius.com:8000/radioviva\\n',\n", | |
" u'http://198.245.61.106:7326\\n',\n", | |
" u'http://aacplus.camo.com.gt:10052/\\n',\n", | |
" u'http://50.7.70.130:8408\\n']" | |
] | |
} | |
], | |
"prompt_number": 71 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": true, | |
"input": [ | |
"for url in real_urls: print(url)" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"http://96.127.183.74:8654\n", | |
"\n", | |
"http://168.144.82.115:7250\n", | |
"\n", | |
"http://edmenstudio.net:8069\n", | |
"\n", | |
"http://panel2.directhostingcenter.com/tunein.php/zxgddufs/playlist.pls\n", | |
"\n", | |
"http://www.grupoalius.com:8000/exafm\n", | |
"\n", | |
"http://radiolatina.info:8759\n", | |
"\n", | |
"http://91.121.134.23:8001/espresiv.mp3\n", | |
"\n", | |
"http://176.31.132.102:7112\n", | |
"\n", | |
"http://198.49.76.250:9193\n", | |
"\n", | |
"http://radiolatina.info:9848\n", | |
"\n", | |
"http://radiolatina.info:9846\n", | |
"\n", | |
"http://radio.libertopolis.com:8000/live\n", | |
"\n", | |
"http://streaming.crwarpaths1.info:8000/magica\n", | |
"\n", | |
"http://giss.tv:8001/lametrofm.mp3\n", | |
"http://giss.tv:8000/lametrofm.mp3\n", | |
"\n", | |
"http://st2.inkaniserver.net:8102\n", | |
"\n", | |
"http://192.99.17.12:2050\n", | |
"\n", | |
"http://srv5.icecaster.com:8000/radiofmamiga\n", | |
"\n", | |
"http://108.178.57.196:11150\n", | |
"\n", | |
"http://stream.serverinfinity.com:7054/\n", | |
"\n", | |
"http://184.172.26.162:8040\n", | |
"\n", | |
"http://radiolatina.info:8725\n", | |
"\n", | |
"http://50.22.219.37:18779/\n", | |
"\n", | |
"http://91.121.134.23:8000/radioatitlan.mp3\n", | |
"\n", | |
"http://50.7.181.186:8072\n", | |
"\n", | |
"http://199.201.89.29:7342/\n", | |
"\n", | |
"http://76.164.217.100:7134/live\n", | |
"\n", | |
"http://85.17.30.50/tunein.php/panamericana/playlist.pls\n", | |
"\n", | |
"http://radioevangelica.com/plenitud.asx\n", | |
"\n", | |
"http://www.grupoalius.com:8000/plus102\n", | |
"\n", | |
"http://69.64.49.34:8010\n", | |
"\n", | |
"http://206.190.135.28:8176\n", | |
"\n", | |
"http://www.grupoalius.com:8000/radiopunto\n", | |
"\n", | |
"http://srv5.icecaster.com:8000/radiofmritmo\n", | |
"\n", | |
"http://192.99.34.205:8567\n", | |
"\n", | |
"http://66.128.53.148:8024/\n", | |
"\n", | |
"http://67.228.177.153:3533/Live\n", | |
"\n", | |
"http://200.6.230.70:8000\n", | |
"\n", | |
"http://85.17.30.50:8235\n", | |
"\n", | |
"http://srv5.icecaster.com:8000/radiofmtropicana.m3u\n", | |
"\n", | |
"http://dns921.no-ip.biz:8000\n", | |
"\n", | |
"http://174.142.111.104:9962\n", | |
"\n", | |
"http://www.grupoalius.com:8000/radioviva\n", | |
"\n", | |
"http://198.245.61.106:7326\n", | |
"\n", | |
"http://aacplus.camo.com.gt:10052/\n", | |
"\n", | |
"http://50.7.70.130:8408\n", | |
"\n" | |
] | |
} | |
], | |
"prompt_number": 75 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [] | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment