Get the Best IPTV Service
#!/bin/bash # freetv.sh - Generate text listing of free-to-air programming in the US from # the LyngSat online database at http://www.lyngsat.com # works with modern GNU versions of the utilities used # requires wget (see below) # - TuxCoder - Aug 7 2004 CBAND="| C " KUBAND="| Ku" # This might work for other regions on LyngSat simply by changing the file name # to another supported region (see http://www.lyngsat.com). REGION="United-States.html" # If wget is not available, you must: # A) manually save the file from the URL below (and replace ${REGION}) # but be sure not to introduce MSsy carriage returns (0x0D/CR)! # B) comment out the next two lines [ -f ${REGION} ] && rm -f ${REGION} wget http://www.lyngsat.com/freetv/${REGION} || exit 1 # Generate text version TEXTFORM=` tr -d '\n' < ${REGION} | \ sed 's//\n/g' | \ sed 's:.*$::g' | \ grep "^::g' -e 's:::g' -e 's:::g' -e 's:
::g' -e "s//$CBAND/g" -e "s//$KUBAND/g" -e 's/<[^>]*>/ /g' -e "s/\(^.\{1,7\}\)\( \)\(| \)/\1 \3/g" -e "s/\(^.\{8,15\}\)\( \)\(| \)/\1 \3/g" -e "s/\(^.\{16,23\}\)\( \)\(| \)/\1 \3/g" -e "s/\(^.\{24,31\}\)\( \)\(| \)/\1 \3/g" -e "s/\(^.\{32,39\}\)\( \)\(| \)/\1 \3/g" -e "s/\(^.\{40,47\}\)\( \)\(| \)/\1 \3/g" -e "s/\(^.\{48,55\}\)\( \)\(| \)/\1 \3/g" -e 's/ |/\n |/g' | sed -e 's/\( .\) /\1 /g' -e 's/\( .\{2,9\}\) /\1 /g' -e 's/\( .\{10,17\}\) /\1 /g' -e 's/\( .\{18,25\}\) /\1 /g' -e 's/ *$//g' || exit 1 ` # Put channel name on every line (for channels on multiple sats) echo "$TEXTFORM" | ( while read A; do if echo $A | grep -q "^|"; then echo "$CHNAME$TABS$A" else echo "$A" CHNAME=`echo "$A" | cut -f1` TABS=" " [ ${#CHNAME} -lt 48 ] && TABS="$TABS " [ ${#CHNAME} -lt 40 ] && TABS="$TABS " [ ${#CHNAME} -lt 32 ] && TABS="$TABS " [ ${#CHNAME} -lt 24 ] && TABS="$TABS " [ ${#CHNAME} -lt 16 ] && TABS="$TABS " [ ${#CHNAME} -lt 8 ] && TABS="$TABS " fi done ) # Comment this line out too if manually providing the lyngsat html file. rm -f ${REGION} Flash Sale Popup