#!/usr/bin/env python

import urllib
Nilesat = urllib.urlretrieve("http://en.kingofsat.net/dl.php?pos=7.0W&fkhz=0",'3530.ini')
Badrsat = urllib.urlretrieve("http://en.kingofsat.net/dl.php?pos=26.0E&fkhz=0",'0260.ini')
Arabsat = urllib.urlretrieve("http://en.kingofsat.net/dl.php?pos=30.5E&fkhz=0",'0305.ini')

the_file = open(Badrsat[0],'r')
the_line = 0
last_transponder = 0

for i in range (1,20):
    the_line = the_file.readline()
#    print the_line
    if the_line.find('0=') != -1:
        last_transponder = int (the_line.lstrip('0='))
        break
    
for j in range (1,(last_transponder+1)):
    the_line = the_file.readline()
    if the_line.strip() == '':
        break
    else:
        x = the_line.split(',')
        N = x[0].find('=')
        #print x
        print 'S' +' ' + x[0][N+1:] + '000' + ' ' + x[1]+ ' ' + x[2] + '000' + ' ' + x[3][0] + '/' + x[3][1]


the_file.close() 
