Skip to content

Instantly share code, notes, and snippets.

@HenryYang
Created January 11, 2018 15:47
Show Gist options
  • Save HenryYang/cdc96a2819baca5f0247998bfa8e5096 to your computer and use it in GitHub Desktop.
Save HenryYang/cdc96a2819baca5f0247998bfa8e5096 to your computer and use it in GitHub Desktop.
Catch Germany DB train Real-time GPS via in-train WiFi
#!/usr/bin/python
# coding: utf8
import requests
import sys
import os
import random
import time
import threading
def t1():
r = requests.get('https://portal.imice.de/api1/rs/status')
fp = open("DB.txt", "a")
fp.write(r.text)
fp.write("\n")
def t2():
while 1:
t1()
time.sleep(3)
if __name__ == '__main__':
reload(sys)
sys.setdefaultencoding('utf-8')
t = threading.Thread(target=t2)
t.start()
@HenryYang
Copy link
Author

Thalys API via in-train WiFi
https://www.ombord.info/api/jsonp/position/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment