luetkmeyer
Joined: 26 Feb 2010 Posts: 38
|
Posted: Wed Mar 03, 2010 1:22 am Post subject: TV guide to brazilian people |
|
|
Hi everyone.
This program shows data grid of channels of Brazil.
Function: Show a TV guide for brazilian people (works only with channels of Brazil);
Some details:
The script download data from Sky (a TV guide on Brazil);
The channel list is customizable ("Config" tab);
The channels are categorized (Movies, Series, Culture, News, Sport, Kids, Open (signal) and Div (uncategorized);
Sign marks: "=" marks actual hour; "-" marks one hour less and one hour more than actual hour; "+" marks 20, 21 and 22 hours;
Button ">" contain options of selected program (view online, synopsis, watch again, movie review etc);;
The data will be downloaded to four days (you will get backward days only when the data was downloaded in that past day);
Special thanks:
jethrow
Any comments or suggestions would be great. Sorry for my poor english.
Em português:
Funçao: Mostrar a programação de canais do Brasil (cabo e sinal aberto);
Alguns detalhes:
O script faz o download a partir do servidor Sky;
A lista de canais é personalizável (aba "Config");
Os canais são categorizados (Movies, Series, Culture, News, Sport, Kids, Open (sinal aberto) e Div (não categorizados);
Marcadores: "=" marca a hora atual; "-" marca uma hora a menos e uma hora a mais da hora atual; e "+" marca as horas 20, 21 e 22;
Os botões ">" contem opções e detalhes do programa selecionado (abrir online, sinopse, novas exibições, revisão do programa etc);
O download armazena quatro dias de dados. Você consiguirá apenas acessar dias anteriores se o download foi realizado em dias anteiores;
Idéias e comentários são bem-vindos.
---
Change log, major updates and ideas to implement:
To implement:
Add a Favorite tab;
Add "now on tv";
Add a reminder;
20110701:
* A lot of improviments;
+ Downloader (exe) help do faster to see additional information;
* Bug fixes;
20110604:
* no more words with caractere coding problem (ANSI x Unicode);
* some bugs fixed;
* improved performance of data;
* GMT choice works to schedule (agenda);
* some changes in report operations to user;
20110602:
* some bugs fixed;
* configuration layout changed;
* added option to choice GMT time in TVGuideBr.ini;
* channel list updated;
*improved performance of view;
20110531:
* some bugs fixed (now working again - for while);
* grid view improviments;
20110531:
* some bugs fixed (now working again - for while);
* grid view improviments;
20100606:
+ Added synopsis in schedule;
* Changed schedule view mode;
20100518:
* Changed schedule option: button to download additional data;
20100509:
+ Added schedule option and categorie;
+ Added option to auto download SBT guide every day;
* Fixed some accent errors;
- Synopsis no longer in messages box;
* Fixed error that show a synopsis for SBT programs;
+ Added hotkey to scroll up fast: Rbutton;
* Changed scoll speed to faster;
20100419:
* Changed language to portuguese (pt-br);
* Recomended minimum screen resolution: 1024;
20100418:
+ Added a vertical scroll: no limitation in number of channels;
* Changed the way to download SBT data;
+ Added help in first use;
+ Added suport autor;
* Changed config tab;
* Changed standard channels;
+ Added list of changes when updating;
* Changed a little the standard font;
20100417:
* Mount data a little faster;
* Download data at least four times faster;
+ Added channel, program description and time when show synopsis;
- Msgbox dont move anymore (to identify a program);
+ Added more details when show synopsis;
+ Added "Watch again": when the program will show again;
+ Added option to view IMDB movie review online;
+ Added showing date after tabs (easy to see);
20100404:
* Changed the source server to a more stable server data: Sky. Now works again;
* Fixed accent problem;
+ Added synopsis for each program;
+ Added HD channels;
- The script do not use COM_L and IE_Control;
- ten day data: now works with four days (Sky limit);
+ choose works in script dir or temp dir;
- Information categorie;
+ Culture and News categories;
* The progress have more information and options;
* More channels: Globo, local channels etc;
+ New buttons to online guide;
20100329
* Fixed download data for the three changes in OiTV source;
+ Added a auto check for update;
+ Added option for a diferente color for the data from OiTV and TVGuia;
- TVGuia source still with problem (data not exist for many channels);
20100312
+ Added reference date of downloaded data in the title bar;
+ Added a option to open a channel in default browser or via IEcontrol;
* Fixed half font change;
+ Added this topic to reference and details;
+ Added button to exit when downloading;
* Change the way of supress some errors when download data fails;
+ Added a button on "Config" tab for the Globo channel (while the parse html isn't solved);
+ Added a "Reset" button to delete all files created and back options to default;
* Change options (Config tab);
- TVGuia source with problem (data not exist for many channels);
20100310
* Config tab is "shape" now (including for monitor with low resolution horizontal - 1024 px);
* Little modification for "Save" and "Check Update": now can you access in "Config" tab;
+ Added some configuration: Font size, color and style;
20100309
* Detect monitor resolution (horizontal) and mount channels from there;
20100308
* Supress some errors when download data fails;
+ Added a "Cancel" button when downloading data;
+ Added a "Update" option.
Compiled download: http://www.autohotkey.net/~luetkmeyer/TVGuideBR.exe
Souce AHK: http://www.autohotkey.net/~luetkmeyer/TVGuideBR.ahk
keywords: programação tv a cabo, guia de programação, grade de programação, grade de canais, guia de tv, software programação, download de programação.
---
Code:
| Code: | #NoEnv
SendMode Input
#SingleInstance,Force
#NoTrayIcon
FileReadLine, WorkingDir, %A_Temp%\TVGuideBR.txt, 1
If ErrorLevel = 1
SetWorkingDir, %A_ScriptDir% ; %A_Temp% %A_ScriptDir% ; Choose directory.
else
SetWorkingDir, %WorkingDir%
CurrentVersion := 20100606
SetTimer, AutoCheckUpdate, -500 ; f:\Icons\Icones\poste-de-travail_la-fouine-du-net_divers.ico
SysGet, Mon, MonitorWorkArea
If ( MonRight < 1100 )
Column = 4
else
Column = 5
IniRead, FontSize, TVGuideBR.ini, Configs, FontSize, 10
IniRead, FontStyle, TVGuideBR.ini, Configs, FontStyle, bold
IniRead, FontColor1, TVGuideBR.ini, Configs, FontColor1, Lime
IniRead, FontColor2, TVGuideBR.ini, Configs, FontColor2, White
IniRead, Synopsis, TVGuideBR.ini, Configs, Synopsis, No
IniRead, GradeDate, TVGuideBR.ini, Data, GradeDate, %A_dd%/%A_MM%
IniRead, ni, TVGuideBR.ini, Data, ni, 32
Gosub, Date
Gui, Font, , Tahoma
FontSize := FontSize . " " . FontStyle
GoGuiSize = Maximize
FileGetSize, Exist, Channels.txt
If ErrorLevel = 1
{
Gosub, CreateFiles
SetTimer, First, -1000
}
FileGetSize, Exist, Grade.txt
If ErrorLevel = 1
{
Gosub, ButtonBaixardados
}
ni += 4 ; ni (defined when download) += 10 (progress independent)
Progress, R0-%ni% h20 w150 ZH20 ZX0 ZY0 CBLime CWBlack, , , Carregando...
ni -= 2
Sleep, 1000
FileDelete, TVGuideBRUpdater.exe
Progress, 1
Gui, font, norm s9
Gui, Add, Button, x10 y5 h22 w30 gGrade_3, %GradeS_3%
g = 2
Loop, 2
{
Gui, Add, Button, x+0 h22 w30 gGrade_%g%, % GradeS_%g%
g--
}
Gui, font, bold
Gui, Add, Button, x+0 y5 h22 Default, Hoje
Gui, font, norm s9
Gui, Add, Button, x+0 y5 h22 w30 gGrade1, %GradeS1%
g = 2
Loop, 2
{
Gui, Add, Button, x+0 h22 w30 gGrade%g%, % GradeS%g%
g++
}
Gui, font, bold s10
Gui, Add, Button, x+5 y5 h22, Baixar dados
Gui, font, norm s9
Gui, Add, Button, x+5 y5 h22, Sky
Gui, Add, Button, x+0 y5 h22, Net
Gui, font, Bold cRed s12
StringLeft, GradeDateDescG, GradeDateDesc, 7
Gui, Add, Text, x1004 y5, %GradeDateDescG% ; 950 to 1024
Gui, font, Bold cYellow s9
Gui, Add, Tab2, x410 y10 Buttons -Wrap y5 w600 choose9 center AltSubmit, Filmes|Seriados|Cultura|News|Esportes|Infantis|Abertos|Div|Agenda|Config
Gosub, Grade
p++
Progress, %p%
Gui, tab, Config
Gui, font, norm cYellow s10
Gui, Add, Text, x10 y40 gAbout, %A_Space% Sobre e mais detalhes (online):`nclique aqui para visitar o tópico oficial no forum da liguagem AHK.`n by luetkmeyer
Gui, Add, Text, x68 y+8 gDonate, Suporte/donativo:
Gui, font, underline
Gui, Add, Text, x+2 gDonate, luetkmeyer@yahoo.com.br
Gui, font, norm bold cSilver s9
Gui, Add, Text, x5 y+17, Definir diretório de trabalho:
Gui, Add, Button, x+37 h22 yp-4, Atual
Gui, Add, Button, x+37 h22, Temporário
Gui, Add, Button, x400 y40 h22, Salvar
Gui, Add, Button, x+10 h22, Atualizar programa
Gui, Add, Button, x+10 h22, Restaurar padrões
Gui, Add, Text, x400 y+9, Fonte:
Gui, Add, Dropdownlist, x+7 yp-5 w40 vFontSize Choose6, 5|6|7|8|9|10|11|12|13|14
Gui, Add, Dropdownlist, x+10 w70 vFontStyle Choose1, Norm|Bold|Italic|Underline
Gui, Add, Dropdownlist, x+10 w70 vFontColor1 Choose2, Lime|White|Red|Silver|Yellow|Aqua|Blue|Fuchsia
Gui, Add, Dropdownlist, x+10 w70 vFontColor2 Choose1, Lime|White|Red|Silver|Yellow|Aqua|Blue|Fuchsia
Gui, Add, Text, x400 y+5, Baixar sinopses de programas antigos:
Gui, Add, Radio, vSynopsis x+0, Sim
Gui, Add, Radio, x+5 Checked, Não
Gui, Add, Text, x400 y+2, %A_Space% SIM: o download dos dados gastará mais tempo`n (25 kB para cada sinopse antiga).
Gui, font, cWhite
Gui, Add, Text, x10 y155, Configuração: marque a checkbox para os canais desejados, escolha sua categoria e configure sua link (visitar online)
p++
Progress, %p%, , , Carreamento completo!
Progress, Off
FileGetTime, DownloadDateM, Grade.txt, M
FormatTime, DownloadDateM, %DownloadDateM%, ddd, dd/MM/yyyy, HH:mm
hGui := WinExist()
OnMessage(0x115, "OnScroll") ; WM_VSCROLL
;OnMessage(0x114, "OnScroll") ; WM_HSCROLL
Gui, +LastFound
GroupAdd, MyGui, % "ahk_id " . WinExist()
;Gui, +E0x40000 +E0x100 +border +resize +0x200000 ; +0x200000 +0x300000 ; WS_VSCROLL | WS_HSCROLL
Gui, +E0x40000 +E0x100 +toolwindow +resize +0x200000 ; Scrool: +0x200000
Gui, color, black
Gui, show, Autosize Maximize, TVGuideBR (%A_Hour%:%A_Min%) Arquivo baixado: %DownloadDateM% Mostrando programação de: %GradeDateDesc% %GradeDateDescG%
WinMaximize, A
Progress, Off
Hotkey, IfWinActive, TVGuideBR (
Hotkey, Rbutton, FastScrollUp
Return
; Main
Date:
{
Grade0 = %A_YYYY%%A_MM%%A_DD%
g = 1
Loop, 3
{
Grade%g% := Grade0
Grade%g% += %g%, days
FormatTime, GradeS%g%, % Grade%g%, ddd
FormatTime, Grade%g%, % Grade%g%, dd/MM
g++
}
g = 1
Loop, 3
{
Grade_%g% := Grade0
Grade_%g% += -%g%, days
FormatTime, GradeS_%g%, % Grade_%g%, ddd
FormatTime, Grade_%g%, % Grade_%g%, dd/MM
g++
}
FormatTime, Grade0, Grade0, dd/MM
GradeDatedesc := GradeDate
StringSplit, GradeDatedesc, GradeDatedesc, /
GradeDateDesc := A_yyyy . GradeDatedesc2 . GradeDatedesc1
FormatTime, GradeDateDesc, %GradeDateDesc%, ddd, dd/MM/yyyy
}
Return
Grade:
{
FileRead, GradeData, Grade.txt
h1 := A_Hour
h2 := A_Hour
h1--
h2++
StringLen, hL, h1
If hL = 1
h1 := "0" . h1
StringLen, hL, h2
If hL = 1
h2 := "0" . h2
p++
Progress, %p%
Loop, Parse, GradeData, |
{
j = 1
Loop, Parse, A_LoopField, `n
{
LoopField := Decode( A_LoopField )
StringSplit, List, LoopField, @
If j = 1
{
Gosub, Categorie
Gui, font, c%FontColor1% s%FontSize% bold
Gui, Tab, % List2
Gui, Add, Button, x%x% y%y% h15 w15 gGoIDChannel -wrap Left, % "> " . List3
Gui, Add, Text, x+0, % List1
j++
p++
Progress, %p%, , , % "Carregando " . List1 . "."
tempChannel = %list1%
}
else
{
Gui, font, c%FontColor2% s%FontSize%
StringLeft, DateList, List1, 5
If ( GradeDate = DateList )
{
AdPlus1 = Yes
StringTrimLeft, List1, List1, 6
StringLeft, List1, List1, 38
StringLen, List3Count, List3
List3Count--
StringLeft, List3, List3, %List3Count%
Gui, Add, Button, x%x% y+0 h15 w15 gGoID -wrap Left, % "> " . List3
StringReplace, List1, List1, %A_Space%-%A_Space%, <->,
if List1 contains %A_Hour%:
StringReplace, List1, List1, <->, %A_Space%=%A_Space%,
if List1 contains %h1%:,%h2%:
StringReplace, List1, List1, <->, %A_Space%%A_Space%-%A_Space%,
if List1 contains 20:,21:,22:
StringReplace, List1, List1, <->, %A_Space%+%A_Space%,
StringReplace, List1, List1, <->, %A_Space%%A_Space%%A_Space%%A_Space%,
Gui, Add, Text, x+0, % List1
v%List3%v := tempChannel "`n`n" . List1 . "`n`n" . List2
a%List3%a := GradeDate . " " List1 . " |"tempChannel . " " . List2
}
If (GradeDate < DateList AND AdPlus1 = "Yes")
{
StringTrimLeft, List1, List1, 6
StringLeft, List1, List1, 38
StringLen, List3Count, List3
List3Count--
StringLeft, List3, List3, %List3Count%
Gui, Add, Button, x%x% y+0 h15 w15 gGoID -wrap Left, % "> " . List3
StringReplace, List1, List1, %A_Space%-%A_Space%, <->,
if List1 contains %A_Hour%:
StringReplace, List1, List1, <->, %A_Space%=%A_Space%,
if List1 contains %h1%:,%h2%:
StringReplace, List1, List1, <->, %A_Space%%A_Space%-%A_Space%,
if List1 contains 20:,21:,22:
StringReplace, List1, List1, <->, %A_Space%+%A_Space%,
StringReplace, List1, List1, <->, %A_Space%%A_Space%%A_Space%%A_Space%,
Gui, Add, Text, x+0, % List1
v%List3%v := tempChannel "`n`n" . List1 . "`n`n" . List2
a%List3%a := GradeDate . " " List1 . " |"tempChannel . " " . List2
AdPlus1 = No
}
}
}
j = 1
}
Gui, font, bold s8
Gui, Tab, Abertos
Gui, Add, Button, xp+0 yp+23 h17, Baixar SBT
Progress, %p%, , , Carregando CONFIG.
i = 1 ; Mount channels on config tab
j = 1
c = 13
xC = 10
xCd = 210
yC = 172
FileRead, GradeData, Channels.txt
Loop, Parse, GradeData, `n, `r
{
p++
Progress, %p%
Loop, parse, A_LoopField, `,
{
ListC_%i%_%j% = %A_LoopField%
j++
}
Gui, font, bold cRed s8
Gui, Tab, Config
Checked := ListC_%i%_2
Gui, Add, CheckBox, x%xC% y%yC% h17 w200 vOnOffC%i% Checked%Checked% -wrap, % ListC_%i%_1 . " ...................................................."
if ( ListC_%i%_3 = "Filmes" )
Cat = 1
if ( ListC_%i%_3 = "Seriados" )
Cat = 2
if ( ListC_%i%_3 = "Cultura" )
Cat = 3
if ( ListC_%i%_3 = "News" )
Cat = 4
if ( ListC_%i%_3 = "Esportes" )
Cat = 5
if ( ListC_%i%_3 = "Infantis" )
Cat = 6
if ( ListC_%i%_3 = "Abertos" )
Cat = 7
if ( ListC_%i%_3 = "Div" )
Cat = 8
Gui, Add, Listbox, x%xCd% y%yC% w65 h17 vCatC%i% Choose%Cat%, Filmes|Seriados|Cultura|News|Esportes|Infantis|Abertos|Div
Gui, Add, Edit, x+1 w450 h17 vUrlC%i% -wrap, % ListC_%i%_5
ChannelDescC%i% := ListC_%i%_1
yC += 18
i++
j = 1
c++
;if c > 36 ; without scroll
;{
; yC = 40
; xC += 325
; xCd += 325
; c = 0
;}
}
p++
Progress, %p%, , , Carregamento completo!
Gui, font, bold cWhite s12
Gui, Tab, Agenda
Gui, Add, Button, x10 y+10 h25, Organizar
Gui, Add, Button, x+64 h25, Abrir agendamentos
Gui, Add, Button, x+63 h25, Apagar agendamentos
FileRead, Agenda, Agenda.txt
FileDelete, Agenda.txt
Sort, Agenda, U
Loop, Parse, Agenda, `n, `r
{
AgendaLine = %A_LoopField%
StringLeft, Agenda_dd,AgendaLine, 5
AgendaDateNow = %A_dd%/%A_MM%
If ( Agenda_dd >= AgendaDateNow )
{
StringSplit,AgendaLine,AgendaLine,|,
Gui, font, cWhite s12
Gui, Add, Text, x10 y+5 w550, %AgendaLine1%
Gui, Add, Text, xp+405 w580, %AgendaLine2%
Gui, font, cLime s6
Gui, Add, Text, x10 y+0, ____________________________________________________________________________________________________________________________________________________________________________________________________________________
AgendaSave .= AgendaLine1 . "|"AgendaLine2 . "`n"
}
}
Fileappend, %AgendaSave%, Agenda.txt
}
Return
Categorie:
{
if List2 = Filmes
{
if ( Filmes < Column )
{
Filmes++
x := 250 * Filmes - 240
y := 30
}
else
{
if ( Filmes < Column * 2 )
{
Filmes++
x := 250 * ( Filmes - Column ) - 240
y := 380
}
else
{
{
Filmes++
x := 250 * ( Filmes - ( Column * 2 ) ) - 240
y := 730
}
}
}
}
if List2 = Seriados
{
if ( Seriados < Column )
{
Seriados++
x := 250 * Seriados - 240
y := 30
}
else
{
Seriados++
x := 250 * ( Seriados - Column ) - 240
y := 500
}
}
if List2 = Abertos
{
if ( Abertos < Column )
{
Abertos++
x := 250 * Abertos - 240
y := 30
}
else
{
Abertos++
x := 250 * ( Abertos - Column ) - 240
y := 500
}
}
if List2 = Cultura
{
if ( Cultura < Column )
{
Cultura++
x := 250 * Cultura - 240
y := 30
}
else
{
Cultura++
x := 250 * ( Cultura - Column ) - 240
y := 500
}
}
if List2 = News
{
if ( News < Column )
{
News++
x := 250 * News - 240
y := 30
}
else
{
News++
x := 250 * ( News - Column ) - 240
y := 500
}
}
if List2 = Div
{
if ( Div < Column )
{
Div++
x := 250 * Div - 240
y := 30
}
else
{
Div++
x := 250 * ( Div - Column ) - 240
y := 500
}
}
if List2 = Esportes
{
if ( Esportes < Column )
{
Esportes++
x := 250 * Esportes - 240
y := 30
}
else
{
Esportes++
x := 250 * ( Esportes - Column ) - 240
y := 500
}
}
if List2 = Infantis
{
if ( Infantis < Column )
{
Infantis++
x := 250 * Infantis - 240
y := 30
}
else
{
Infantis++
x := 250 * ( Infantis - Column ) - 240
y := 500
}
}
}
Return
; About data
ButtonHoje:
{
GradeDate = %Grade0%
IniWrite, %GradeDate%, TVGuideBR.ini, Data, GradeDate
reload
}
return
Grade_3:
{
GradeDate = %Grade_3%
IniWrite, %GradeDate%, TVGuideBR.ini, Data, GradeDate
reload
}
return
Grade_2:
{
GradeDate = %Grade_2%
IniWrite, %GradeDate%, TVGuideBR.ini, Data, GradeDate
reload
}
return
Grade_1:
{
GradeDate = %Grade_1%
IniWrite, %GradeDate%, TVGuideBR.ini, Data, GradeDate
reload
}
return
Grade3:
{
GradeDate = %Grade3%
IniWrite, %GradeDate%, TVGuideBR.ini, Data, GradeDate
reload
}
return
Grade2:
{
GradeDate = %Grade2%
IniWrite, %GradeDate%, TVGuideBR.ini, Data, GradeDate
reload
}
return
Grade1:
{
GradeDate = %Grade1%
IniWrite, %GradeDate%, TVGuideBR.ini, Data, GradeDate
reload
}
return
ButtonBaixarDados:
{
IniRead, nc, TVGuideBR.ini, Data, nc, 31
p = 0
ni = 0
nc1 := nc + 1
XP := MonRight - 245
YP := MonBottom - 75
Progress, R0-%nc1% x%XP% y%YP% h20 w240 ZH20 ZX0 ZY0 CBLime CWBlack, , , Progress, %p%, , , Baixando canal %p% de %nc%.
Progress, %p%, , , Baixando canal %p% de %nc%.
Sleep, 500
FileDelete, Grade.txt
WinGetPos, X3Gui, Y3Gui, W3Gui, H3Gui, Baixando canal
Y3Gui := ( Y3Gui + H3Gui )
X3Gui := ( X3Gui + 3 ) ; W3Gui )
Gui, 3: -E0x40000 -E0x100 +toolwindow -resize -caption +AlwaysOnTop
Gui, 3: color, black
Gui, 3: font, bold s8
Gui, 3: Add, Button, x0 y0 w80 h20 default, Ocultar
Gui, 3: Add, Button, x+0 y0 w80 h20, Recarregar
Gui, 3: Add, Button, x+0 y0 w80 h20, Sair
Gui, 3: show, w240 h20 Center x%x3Gui% y%y3Gui%, Cancelar...
;Gui, 3: show, w60 h30 Center x%X3Gui%, Cancelar.
Sleep, 500
FormatTime, DateDDMM, %DateInfo%, LongDate
IniWrite, %DateDDMM%, TVGuideBR.ini, Data, DateData
i = 1
j = 1
FileRead, GradeData, Channels.txt
Loop, Parse, GradeData, `n, `r
{
Loop, parse, A_LoopField, `,
{
List_%i%_%j% = %A_LoopField%
j++
}
if List_%i%_1 = SBT
{
ni++
p++
DataSBT1 = %A_DD%/%A_MM%--
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (| " . List_%i%_1 . ")."
FileAppend, % List_%i%_1 . "@" . List_%i%_3 . "@" . List_%i%_5 . "`n" , Grade.txt
href1 := "http://www.sbt.com.br/programacao"
UrlDownloadToFile, %href1%, href1.txt
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (/ " . List_%i%_1 . ")."
FileRead, href1, href1.txt
Loop, Parse, href1, `n, `r
{
If A_Index > 150
{
If A_LoopField contains </strong> 
{
StringReplace, DataSBT, A_LoopField, </li>,</li>`n%A_DD%/%A_MM%--,All
HTM = %DataSBT%
DataSBT := UnHTM( HTM )
DataSBT1 .= DataSBT
}
}
}
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (- " . List_%i%_1 . ")."
DataSBTAll =
Loop, Parse, DataSBT1, `n, `r
{
If A_LoopField contains `:
{
StringReplace, DataSBT, A_LoopField, %A_Space%,%A_Space%-%A_Space%,
DataSBTAll .= DataSBT . "@SBT: não há sinopses e opções para este canal. Visite SBT online (botão SBT) para mais detalhes. Escolha Não nesta caixa!@000000`n"
}
}
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (\ " . List_%i%_1 . ")."
StringReplace, DataSBTAll, DataSBTAll, --,%A_Space%,All
FileAppend, %DataSBTAll%, Grade.txt
Sleep, 100
break
}
if List_%i%_2 = 1
{
ni++
p++
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (| " . List_%i%_1 . ")."
FileAppend, % List_%i%_1 . "@" . List_%i%_3 . "@" . List_%i%_5 . "`n" , Grade.txt
ChCode := List_%i%_4
href1 := "http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=" . ChCode
href2 := "http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=" . ChCode . "&__qsModo=Rss"
UrlDownloadToFile, %href1%, href1.txt
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (/ " . List_%i%_1 . ")."
UrlDownloadToFile, %href2%, href2.txt
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (- " . List_%i%_1 . ")."
FileRead, href1, href1.txt
Loop, Parse, href1, `n, `r
{
If A_LoopField contains ../Ficha/Default.aspx?__qsFicha=
{
StringReplace, Date, A_LoopField, <td width="10"></td><td>,,
StringReplace, Date, Date, </td><td width="10"></td><td>,%A_Space%,
StringReplace, Date, Date, </td>,%A_Space%-%A_Space%@,
StringReplace, Date, Date, %A_Tab%%A_Tab%,,All
StringSplit, Date, Date, @,
StringReplace, Date2, Date2, <td width="10"></td><td><a href='../Ficha/Default.aspx?__qsFicha=,,
StringReplace, Date2, Date2, '>,@,
StringSplit, Link, Date2, @,
StringReplace, Title, Link2, </a></td><td width="10"></td>,,
StringTrimLeft, Time1, Date1, 6
StringLeft, Time1, Time1, 5
Time2 = %A_Hour%:%A_Min%
If ( Time1 < Time2 )
{
If ( Synopsis = "Yes" )
{
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (SYN: " . List_%i%_1 . ")."
href3 := "http://www.sky.com.br/guiadatv/Ficha/Default.aspx?__qsFicha=" . Link1
UrlDownloadToFile, %href3%, href3.txt
FileRead, href3, href3.txt
Loop, Parse, href3, `n, `r
{
If A_LoopField contains <div id="ctl00_ContentPlaceHolder_FreeBox_canBoxRed_Descricao_dProgramDescription">
{
StringReplace, Desc, A_LoopField, <div id="ctl00_ContentPlaceHolder_FreeBox_canBoxRed_Descricao_dProgramDescription">,,
StringReplace, Desc, Desc, </div>,,
StringTrimLeft, Desc, Desc, 14
StringReplace, Desc, Desc, <br/><br/>,%A_Space%,All
StringReplace, Desc, Desc, <br>,,All
StringReplace, Desc, Desc, @,%A_Space%at%A_Space%,All
StringReplace, Desc, Desc, `n,,All
}
}
StringReplace, Date1, Date1, @, A,
FileAppend, %Date1%%Title%@%Desc%@%Link1%`n, Grade.txt
}
else
{
StringReplace, Date1, Date1, @, A,
FileAppend, %Date1%%Title%@A opção para sincronizar sinopses antigas está desabilitada.@%Link1%`n, Grade.txt
}
}
else
{
break
}
}
}
Sleep, 100
Progress, %p%, , , % "Baixando " . p . "/" . nc . " (\ " . List_%i%_1 . ")."
FileRead, href2, href2.txt
Loop, Parse, href2, `n, `r
{
If A_LoopField contains <title><![CDATA[Data
{
StringReplace, Title, A_LoopField, <title><![CDATA[Data%A_Space%,,All
StringReplace, Title, Title, ]]></title>,,All
StringReplace, Title, Title, %A_Tab%%A_Tab%%A_Tab%%A_Tab%,,All
StringReplace, Title, Title, @, A,All
}
If A_LoopField contains /Ficha/Default.aspx?__qsFicha=
{
StringReplace, Link, A_LoopField, <link>http://www.sky.com.br/GuiaDaTV/Ficha/Default.aspx?__qsFicha=,,All
StringReplace, Link, Link, </link>,,All
StringReplace, Link, Link, %A_Tab%%A_Tab%%A_Tab%%A_Tab%,,All
}
If A_LoopField contains <description><![CDATA[
{
StringReplace, Desc, A_LoopField, <description><![CDATA[,,All
StringReplace, Desc, Desc, ]]></description>,,All
StringReplace, Desc, Desc, %A_Tab%%A_Tab%%A_Tab%%A_Tab%,,All
StringReplace, Desc, Desc, <br/><br/>,%A_Space%,All
StringReplace, Desc, Desc, @, A,All
StringReplace, Desc, Desc, `n,,All
FileAppend, %Title%@%Desc%@%link%`n, Grade.txt
}
}
FileAppend, |, Grade.txt
Sleep, 100
}
i++
j = 1
}
Filedelete, href*.txt
IniWrite, %A_dd%/%A_MM%, TVGuideBR.ini, Data, GradeDate
IniWrite, %ni%, TVGuideBR.ini, Data, ni
Progress, %nc1%, , , Sincronização completa!
Gui, 3: Destroy
Sleep, 1000
Progress, Off
Reload
}
Return
ButtonBaixarSBT:
{
Msgbox, 4096, Iniciando..., Os dados serão baixados agora., 2
DataSBT1 = %A_DD%/%A_MM%--
href1 := "http://www.sbt.com.br/programacao"
UrlDownloadToFile, %href1%, href1.txt
FileRead, href1, href1.txt
Loop, Parse, href1, `n, `r
{
If A_Index > 150
{
If A_LoopField contains </strong> 
{
StringReplace, DataSBT, A_LoopField, </li>,</li>`n%A_DD%/%A_MM%--,All
HTM = %DataSBT%
DataSBT := UnHTM( HTM )
DataSBT1 .= DataSBT
}
}
}
DataSBTAll =
Loop, Parse, DataSBT1, `n, `r
{
If A_LoopField contains `:
{
StringReplace, DataSBT, A_LoopField, %A_Space%,%A_Space%-%A_Space%,
DataSBTAll .= DataSBT . "@SBT: não há sinopses e opções para este canal. Visite SBT online (botão SBT) para mais detalhes. Escolha Não nesta caixa!@000000`n"
}
}
StringReplace, DataSBTAll, DataSBTAll, --,%A_Space%,All
FileAppend, %DataSBTAll%, Grade.txt
Sleep, 100
Reload
}
Return
; Others buttons
ButtonSalvar:
{
FileDelete, Channels.txt
nc = 0
i = 1
SaveC =
Gui, Submit, nohide
Loop,
{
if ChannelDescC%i% <>
{
SaveC := SaveC . ChannelDescC%i% . "," . OnOffC%i% . "," . CatC%i% . "," . ListC_%i%_4 . "," . UrlC%i% . "`n"
If ( OnOffC%i% = 1 )
nc++
i++
}
else
{
break
}
}
If ( GoOnlineMode = 1 )
IniWrite, DefaultBrowser, TVGuideBR.ini, Configs, GoOnlineMode
If ( GoOnlineMode = 2 )
IniWrite, IEControl, TVGuideBR.ini, Configs, GoOnlineMode
If ( Synopsis = 1 )
IniWrite, Yes, TVGuideBR.ini, Configs, Synopsis
If ( Synopsis = 2 )
IniWrite, No, TVGuideBR.ini, Configs, Synopsis
FileAppend, %saveC%, Channels.txt
IniWrite, %FontSize%, TVGuideBR.ini, Configs, FontSize
IniWrite, %FontStyle%, TVGuideBR.ini, Configs, FontStyle
IniWrite, %FontColor1%, TVGuideBR.ini, Configs, FontColor1
IniWrite, %FontColor2%, TVGuideBR.ini, Configs, FontColor2
IniWrite, %nc%, TVGuideBR.ini, Data, nc
FileDelete, Grade.txt
Reload
}
Return
ButtonSky:
Run, http://www.sky.com.br/guiadatv/canais/
Return
ButtonNet:
Run, http://netcombo.globo.com/netPortalWEB/index.portal?_nfpb=true&_pageLabel=programacao_gradedecanais_gradedecanais_home_page
Return
ButtonAtualizarPrograma:
{
URLDownloadToFile, http://www.autohotkey.net/~luetkmeyer/UpdatedVersion.txt, UpdatedVersion.txt
FileReadLine, UpdatedVersion, UpdatedVersion.txt, 1
If ErrorLevel = 1
{
Msgbox, Falha na procura por uma nova versão do programa!
FileDelete, UpdatedVersion.txt
Reload
}
else
{
FileDelete, UpdatedVersion.txt
If ( CurrentVersion < UpdatedVersion )
{
URLDownloadToFile, http://www.autohotkey.net/~luetkmeyer/UpdatedVersionChanges.txt, UpdatedVersionChanges.txt
FileRead, UpdatedVersionChanges, UpdatedVersionChanges.txt
FileDelete, UpdatedVersionChanges.txt
Tooltip, %UpdatedVersionChanges%, 0, 0,
Msgbox, 4, Nova versão encontrada!, Uma nova versão deste programa está disponível.`n`nVersão atual: %CurrentVersion%`nNova versão: %UpdatedVersion%`n`nDeseja atualizar agora?`n(configurações personalizadas serão perdidas)
Ifmsgbox no
{
reload
}
IfMsgbox yes
{
Tooltip
Tooltip, Atualização em progresso (000`%). Por favor aguarde...
URLDownloadToFile, http://www.autohotkey.net/~luetkmeyer/TVGuideBR.exe, TVGuideBRNew.exe
Tooltip, Atualização em progresso (050`%). Por favor aguarde...
URLDownloadToFile, http://www.autohotkey.net/~luetkmeyer/TVGuideBRUpdater.exe, TVGuideBRUpdater.exe
Tooltip, Atualização completa! (100`%).
Sleep, 1000
Tooltip
Run, TVGuideBRUpdater.exe
Exitapp
}
}
else
{
Msgbox, , Versão atualizada!, Esta versão do programa é a mais recente.`n`nVersão atual: %CurrentVersion%`nVersão do servidor: %UpdatedVersion%
Reload
}
}
}
Return
About:
{
Run, http://www.autohotkey.com/forum/topic55240.html
}
Return
Donate:
{
Run, mailto:luetkmeyer@yahoo.com.br
}
Return
ButtonRestaurarPadrões:
{
Filedelete, Channels.txt
Filedelete, Grade.txt
Filedelete, TVGuideBR.ini
reload
}
Return
ButtonAtual:
{
Gui, hide
FileDelete, %A_Temp%\TVGuideBR.txt
Filedelete, %A_ScriptDir%\Channels.txt
Filedelete, %A_ScriptDir%\Grade.txt
Filedelete, %A_ScriptDir%\TVGuideBR.ini
FileDelete, %A_Temp%\TVGuideBR.txt
Filedelete, %A_Temp%\Channels.txt
Filedelete, %A_Temp%\Grade.txt
Filedelete, %A_Temp%\TVGuideBR.ini
Reload
}
Return
ButtonTemporário:
{
Gui, hide
FileDelete, %A_Temp%\TVGuideBR.txt
Filedelete, %A_ScriptDir%\Channels.txt
Filedelete, %A_ScriptDir%\Grade.txt
Filedelete, %A_ScriptDir%\TVGuideBR.ini
FileDelete, %A_Temp%\TVGuideBR.txt
Filedelete, %A_Temp%\Channels.txt
Filedelete, %A_Temp%\Grade.txt
Filedelete, %A_Temp%\TVGuideBR.ini
Sleep, 1000
FileAppend, %A_Temp%, %A_Temp%\TVGuideBR.txt
Sleep, 1000
Reload
}
Return
ButtonOrganizar:
{
Reload
}
Return
ButtonAbrirAgendamentos:
{
Run, Agenda.txt
}
Return
ButtonApagarAgendamentos:
{
FileDelete, Agenda.txt
Reload
}
Return
2ButtonBaixarInformaçõesAdicionais:
{
WinSet, Transparent, 200, TVGuideBR (
Gui, 2: Add, Button, x450 y5 h25, Baixando! Por favor aguarde...
Gui, 2: Show, Autosize Center, Detalhes do programa
SetTimer, DownloadAddSyn, -100
}
Return
2ButtonSky+Online:
{
url := "http://www.sky.com.br/guiadatv/Ficha/Default.aspx?__qsFicha=" . temp
Run, %url%
Gui, 2: Destroy
WinSet, Transparent, OFF, TVGuideBR (
}
Return
2ButtonIMDB+Online:
{
StringGetPos, DescSynIi, DescSynI, `n,
StringLeft, DescSynIN, DescSynI, %DescSynIi%
StringReplace, DescSynIN, DescSynIN, %A_Space%, +, All
url2 := "http://www.imdb.com/find?s=all&q=" . DescSynIN . "&x=0&y=0"
Run, %url2%
Gui, 2: Destroy
WinSet, Transparent, OFF, TVGuideBR (
}
Return
2ButtonAgendarPrograma:
{
FileAppend, % a%temp%a . "`n", Agenda.txt
SetTimer, DownloadAddSyn, Off
Gui, 2: Destroy
WinSet, Transparent, OFF, TVGuideBR (
WinActivate, TVGuideBR (
Msgbox, 4096, Agendado!, Agendamento concluído com sucesso!, 2
}
Return
3ButtonRecarregar:
Reload
3ButtonSair:
Exitapp
3ButtonOcultar:
{
Gui, 3: destroy
;Gui, hide
XProgress := MonRight + 2
Progress, x%XProgress% R0-0 h0 w0 ZH0 ZX0 ZY0 CBLime CWBlack A B, , , Progress, %p%, , , Baixando canal %p% de %nc%.
}
Return
; Subrotine and timers
AutoCheckUpdate:
{
URLDownloadToFile, http://www.autohotkey.net/~luetkmeyer/UpdatedVersion.txt, UpdatedVersion.txt
FileReadLine, UpdatedVersion, UpdatedVersion.txt, 1
FileDelete, UpdatedVersion.txt
If ( CurrentVersion < UpdatedVersion )
Msgbox, 4096, Nova versão encontrada!, Uma nova versão deste programa está disponível.`n`nVersão atual: %CurrentVersion%`nNova Versão: %UpdatedVersion%`n`nUse a opção "Atualizar programa" na aba "Config" para instalar a nova versão., 10
}
Return
GoID:
{
Gui, 2: Destroy
WinSet, Transparent, 200, TVGuideBR (
GuiControlGet, temp, FocusV
StringTrimLeft, temp, temp, 2
Gui, 2: -E0x40000 -E0x100 +toolwindow -resize +AlwaysOnTop
Gui, 2: color, black
Gui, 2: font, cLime bold s10
Gui, 2: Add, Text, x10 y5 w800, % v%temp%v
Gui, 2: Add, Button, x450 y5 h25, Baixar informações adicionais
Gui, 2: Add, Button, x+10 h25, Agendar programa
Gui, 2: Add, Button, x+10 h25, Sky+Online
Gui, 2: show, autosize Center, Detalhes do programa
}
Return
GoIDChannel:
{
GuiControlGet, temp, FocusV
StringTrimLeft, temp, temp, 2
Run, %temp%
}
Return
FastScrollUp:
{
Loop, 100
Gosub, WheelUp
}
Return
DownloadAddSyn:
{
SetTimer, DownloadAddSyn, off
NextExibs = 0
DescSynNE =
href4 := "http://www.sky.com.br/guiadatv/Ficha/Default.aspx?__qsFicha=" . temp
UrlDownloadToFile, %href4%, href4.txt
If ErrorLevel = 0
{
FileRead, href4, href4.txt
Loop, Parse, href4, `n, `r
{
If NextExibs <> 0
NextExibs++
If NextExibs > 2
{
If A_LoopField contains <td>
{
StringReplace, DescSynN, A_LoopField, <td>,,
StringReplace, DescSynN, DescSynN, </td><td>,%A_Space%,
StringReplace, DescSynN, DescSynN, </td>,,
StringReplace, DescSynN, DescSynN, %A_Tab%,,All
DescSynNE .= DescSynN . "`n"
}
If A_LoopField contains </table>
break
}
If A_LoopField contains InfoBasica_dBasicInfo
{
StringReplace, DescSynI, A_LoopField, <div id="ctl00_ContentPlaceHolder_FreeBox_canBoxRed_InfoBasica_dBasicInfo" class="basicInfo"><strong>,,
StringReplace, DescSynI, DescSynI, </strong><br/><br /><strong>,|,
StringReplace, DescSynI, DescSynI, </strong>,,All
StringReplace, DescSynI, DescSynI, <br /><strong>,|,All
StringReplace, DescSynI, DescSynI, </div>,,All
StringReplace, DescSynI, DescSynI, <br/>,%A_Space%,All
StringReplace, DescSynI, DescSynI, %A_Tab%,,All
StringReplace, DescSynI, DescSynI, |,`n,All
DescSynI .= "`n`n"
}
If A_LoopField contains Descricao_dProgramDescription
{
StringReplace, DescSynD, A_LoopField, <div id="ctl00_ContentPlaceHolder_FreeBox_canBoxRed_Descricao_dProgramDescription">,,
StringReplace, DescSynD, DescSynD, </strong><br/><br /><strong>,|,
StringReplace, DescSynD, DescSynD, <br/>,%A_Space%,All
StringReplace, DescSynD, DescSynD, <br>,,All
StringReplace, DescSynD, DescSynD, </div>,,All
StringReplace, DescSynD, DescSynD, %A_Space%%A_Space%,,All
DescSynD .= "`n`n"
}
If A_LoopField contains Exibicoes_DataGrid_Programa_Exibicoes
{
NextExibs = 1
}
}
Filedelete, href*.txt
DescSynI := Decode( DescSynI )
DescSynD := Decode( DescSynD )
DescSynNE := Decode( DescSynNE )
WinSet, Transparent, 200, TVGuideBR (
Gui, 2: Destroy
Gui, 2: +toolwindow -resize +AlwaysOnTop
Gui, 2: Color, black
Gui, 2: Font, cLime bold s10
Gui, 2: Add, Text, x10 y5 w800, % v%temp%v
Gui, 2: Font, cWhite bold s10
Gui, 2: Add, Text, y+30, Detalhes adicionais baixados agora:
Gui, 2: Add, Text, y+10 w800, % DescSynI . DescSynD
Gui, 2: Add, Text, y+0, Novas exibições (clique no botão para agendar):
Loop, Parse, DescSynNE, `n, `r
{
If ( A_LoopField <> "" )
{
DescSynNEtemp = %A_LoopField%
Gui, 2: Add, Button, y+0 gAgendar w800 h20 Left, % DescSynNEtemp
}
}
Gui, 2: Add, Button, x450 y5 h25, Agendar programa
Gui, 2: Add, Button, x+10 h25, Sky+Online
Gui, 2: Add, Button, x+10 h25, IMDB+Online
Gui, 2: Show, Autosize Center, Detalhes do programa
}
}
Return
Agendar:
{
GuiControlGet, temp, FocusV
StringRight, NEHour, temp, 8
StringLeft, NEHour, NEHour, 5
StringRight, NEDate, temp, 19
StringLeft, NEDate, NEDate, 5
StringTrimRight, NEChannel, temp, 20
StringReplace, NEChannel, NEChannel, %A_Space%, _, All
Loop, parse, DescSynI, `n, `r
{
NEDesc = %A_LoopField%
Break
}
FileAppend, % NEDate . " " NEHour . " "NEDesc . " |" . NEChannel . "`n", Agenda.txt
Msgbox, 4096, Agendado!, Agendamento concluído com sucesso!, 2
}
Return
Decode( str )
{
RawLen := StrLen(str)
BufSize := (RawLen + 1) * 2
VarSetCapacity(Buf, BufSize, 0)
DllCall("MultiByteToWideChar", "uint", 65001, "int", 0, "str", str
, "int", -1, "uint", &Buf, "uint", RawLen + 1)
DllCall("WideCharToMultiByte", "uint", 1252, "int", 0, "uint", &Buf, "int", -1
, "str", str, "uint", RawLen + 1
, "int", 0, "int", 0)
Return str
}
; First use and reset
CreateFiles:
{
FileAppend,
(
HD_CAMPEONATO_ESPANHOL,0,Esportes,778,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=778
HD_DISCOVERY_THEATER,0,Cultura,760,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=760
HD_DISCOVERY_TLC,0,Cultura,777,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=777
HD_DISNEY_CHANNEL,0,Cultura,779,http://www.disney.com.br/disneychannel/programacao/
HD_ESPN,0,Esportes,758,http://espnbrasil.terra.com.br/programacao
HD_FOX_NATGEO,0,Cultura,759,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=759
HD_GLOBOSAT,0,Div,772,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=772
HD_HBO,0,Filmes,766,http://www.hbo-br.tv/programacion.asp
HD_MGM,0,Filmes,763,http://www.canalmgm.tv/programacion.jsp
HD_MULTISHOW,0,Div,774,http://multishow.globo.com/Programacao/horarios.shtml
HD_RUSH,0,Seriados,764,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=764
HD_SPACE,0,Seriados,761,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=761
HD_TELECINE_HD,0,Filmes,775,http://globosat.globo.com/telecine/servicos/programacao.asp
HD_TELECINE_PIPOCA,0,Filmes,780,http://globosat.globo.com/telecine/servicos/programacao.asp
HD_TNT,0,Filmes,762,http://www.tntla.com/br/schedule/index.jsp
HD_VH1,0,Div,776,http://vh1brasil.uol.com.br/programas/canal/VH1/
TELECINE_PREMIUM,1,Filmes,603,http://globosat.globo.com/telecine/servicos/programacao.asp
TELECINE_PIPOCA,1,Filmes,606,http://globosat.globo.com/telecine/servicos/programacao.asp
TELECINE_ACTION,1,Filmes,604,http://globosat.globo.com/telecine/servicos/programacao.asp
TELECINE_LIGHT,0,Filmes,606,http://globosat.globo.com/telecine/servicos/programacao.asp
TELECINE_CULT,0,Filmes,607,http://globosat.globo.com/telecine/servicos/programacao.asp
HBO,1,Filmes,612,http://www.hbo-br.tv/programacion.asp
HBO_Family,0,Seriados,616,http://www.hbofamily-br.tv/programacion.asp
HBO_Family_e,0,Seriados,617,http://www.hbofamily-br.tv/programacion.asp
HBO_Plus,1,Filmes,614,http://www.hboplus-br.tv/programacion.asp
HBO_Plus_e,0,Filmes,615,http://www.hboplus-br.tv/programacion.asp
HBO2,0,Filmes,613,http://www.hbo-br.tv/programacion.asp
CINEMAX,0,Filmes,618,http://www.cinemax-br.tv/programacion.asp
CINEMAX_2,0,Filmes,619,http://www.cinemax-br.tv/programacion.asp
MAXPRIME,1,Filmes,620,http://www.maxprime-br.tv/programacion.asp
MAXPRIME_e,0,Filmes,621,http://www.maxprime-br.tv/programacion.asp
TNT,1,Filmes,602,http://www.tntla.com/br/schedule/index.jsp
MEGAPIX,0,Filmes,601,http://megapix.globo.com/
MGM,0,Filmes,609,http://www.canalmgm.tv/programacion.jsp
SPACE,0,Filmes,600,http://grilla.canalspace.tv//fe/sites/portugues/grilla/index?layout=grilla&channel_id=5
STUDIO_UNIVERSAL,0,Filmes,599,http://www.studiouniversaltv.com/br/programacion.php
TCM,0,Filmes,598,http://www.tcmla.com/pt/programming/index.html
EUROCHANNEL,0,Filmes,622,http://www.eurochannel.com/index.php?option=com_jevents&task=day.listevents&Itemid=37&lang=pt
CANAL_BRASIL,0,Filmes,608,http://canalbrasil.globo.com/grade.php
ANIMAX,0,Seriados,623,http://br.animaxtv.com/shows/schedule
AXN,1,Seriados,590,http://br.axn.com/shows/schedule
E!,0,Seriados,576,http://www.e1tv.com/
FOX,1,Seriados,587,http://www.canalfox.com.br/br/programacao
FOX_LIFE,0,Seriados,575,http://www.foxlife.com.br/br/programacao
FX,0,Seriados,589,http://www.fxbrasil.com.br/br/programacao/
MANAGEMENTV,0,Seriados,596,http://www.managementv.com.br/programacao.asp
SCI-FI,0,Seriados,588,http://www.scifibrasil.com/br/programacao
SONY,0,Seriados,591,http://br.canalsony.com/shows/schedule
THE_WARNER_CHANNEL,1,Seriados,586,http://www.wbla.com/schedules/daily/
UNIVERSAL_CHANNEL,1,Seriados,585,http://portal.mec.gov.br/tvescola/
BOOMERANG,0,Infantis,630,http://www.boomixla.com/boomerang/public/DailySchedule.action
CARTOON_NETWORK,1,Infantis,629,http://www.cartoonnetwork.com.br/
DISCOVERY_KIDS,0,Infantis,628,http://www.discoverykidsbrasil.com/programacao/
DISNEY,1,Infantis,627,http://www.disney.com.br/disneychannel/programacao/
DISNEY_XD,1,Infantis,632,http://disney.com.br/disneyxd/programacao/
NICKELODEON,1,Infantis,631,http://mundonick.uol.com.br/canal/horarios/
RA_TIM_BUM,0,Infantis,633,http://www.tvratimbum.com.br/secoes/programacao/dia.php
BANDSPORTS,0,Esportes,570,http://bandsports.band.com.br/programacao/
CAMPEONATO_ESPANHOL,0,Esportes,665,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=665
CAMPEONATO_ESPANHOL_2,0,Esportes,666,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=666
ESPN,1,Esportes,572,http://espnbrasil.terra.com.br/programacao
ESPN_BRASIL,1,Esportes,573,http://espnbrasil.terra.com.br/programacao
SPEED_CHANNEL,0,Esportes,571,http://www.canalspeed.com.br/br/programacao
SPORTV,1,Esportes,581,http://sportv.globo.com/
SPORTV_2,1,Esportes,580,http://sportv.globo.com/
THE_GOLF_CHANNEL,0,Esportes,569,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=569
A&E_MUNDO,0,Cultura,592,http://www.aeweb.tv/br/horarios/
DISCOVERY_CHANNEL,1,Cultura,594,http://www.discoverybrasil.com/programacao-de-tv/?type=day&country_code=BR
DISCOVERY_HOME&HEALTH,0,Cultura,579,Information,http://www.discoverybrasil.com/programacao-de-tv/?type=day&country_code=BR&channel_code=DHBR-PRT
DISCOVERY_TRAVEL&LIVING,0,Cultura,578,http://www.discoverybrasil.com/programacao-de-tv/?type=day&country_code=BR&channel_code=TLBR-PRT
ANIMAL_PLANET,1,Cultura,595,http://www.discoverybrasil.com/programacao-de-tv/?type=day&country_code=BR&channel_code=APBR-PRT
GNT,1,Cultura,583,http://gnt.globo.com/Programacao/
NATIONAL_GEOGRAFIC,0,Cultura,593,http://www.natgeo.com.br/br/programacao
PEOPLE&ARTS,0,Cultura,577,http://www.peopleandarts.com/
THE_HISTORY_CHANNEL,0,Cultura,597,http://www.seuhistory.com/br/horarios/
FUTURA,1,Cultura,552,http://www.futura.org.br/main.asp
TV_ESCOLA,0,Cultura,650,http://portal.mec.gov.br/tvescola/
TV_CULTURA,1,Cultura,652,http://www.tvcultura.com.br/grade/index.php
BANDNEWS,0,News,636,http://bandnewstv.band.com.br/index.asp
BBC_WORLD,0,News,637,http://www.bbc.co.uk/
BLOOMBERG,0,News,635,http://www.bloomberg.com/br
CLIMATEMPO,0,News,640,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=640
CNN_INTERNACIONAL,0,News,638,http://www.cnn.com/
FOX_NEWS,0,News,641,http://www.foxnews.com/
GLOBO_NEWS,1,News,582,http://globonews.globo.com/
MULTISHOW,1,Div,584,http://multishow.globo.com/Programacao/horarios.shtml
PLAY_TV,0,Div,626,http://www.playtv.com.br/new/site/programacao.php
VH1,0,Div,624,http://vh1brasil.uol.com.br/programas/canal/VH1/
VH1_MEGA_HITS,0,Div,625,http://vh1brasil.uol.com.br/programas/canal/VH1/
RIT,0,Div,773,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=773
TV5_MONDE,0,Div,646,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=646
BOA_VONTADE_TV,0,Div,566,http://www.boavontade.com/tv/grade.php
CANAL_RURAL,0,Div,643,http://www.canalrural.com.br/canalrural/jsp/default.jspx?uf=1&local=1&action=programacao_canal§ion=programacao
CANÇÃO_NOVA,0,Div,634,http://www.cancaonova.com/portal/canais/tvcn/tv/progs.php
MSR_TV,0,Div,755,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=755
SHOPTIME,0,Div,563,http://www.shoptime.com.br/TVShoptime
SHOPTOUR,0,Div,560,http://www.shoptour.com.br/tv
TERRA_VIVA,0,Div,642,http://tvterraviva.band.com.br/grade.asp
TV_NOVO_TEMPO,0,Div,673,http://www.novotempo.org.br/tv/novo/grade.php
FASHION_TV,0,Div,574,http://www.ftvla.com/general/grilla_prog/manana_brasil.html
TV_PARANÁ_EDUCATIVA,0,Div,756,http://www.rtve.pr.gov.br/modules/conteudo/conteudo.php?conteudo=12
NBR,0,Div,757,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=757
SESCTV,0,Div,547,http://www.sesctv.com.br/programacao.cfm
TV_BRASIL,1,Div,653,http://www.tvbrasil.org.br/programacao/
TV_CAMARA,0,Div,651,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=651
TV_JUSTIÇA,0,Div,654,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=654
TV_SENADO,0,Div,655,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=655
DEUTSCHE_WELLE,0,Div,648,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=648
NHK,0,Div,649,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=649
RAI,0,Div,644,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=644
SIC,0,Div,645,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=645
TV_ESPANHA,0,Div,647,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=647
GLOBO_RJ,1,Abertos,548,http://redeglobo.globo.com/programacao.html
GLOBO_SP,0,Abertos,549,http://redeglobo.globo.com/programacao.html
GLOBO_BAHIA_SHOPBUY,0,Abertos,555,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=555
RECORD,1,Abertos,558,http://rederecord.r7.com/programacao.html
BAND,1,Abertos,559,http://www.band.com.br/programacao/
REDE_TV,1,Abertos,565,http://www.redetv.com.br/grade.aspx
REDE_VIDA,0,Abertos,564,http://www.redevida.com.br/programacao.php
CNT,1,Abertos,553,http://www.cnt.com.br/index.php/programacao/programacao-rio-de-janeiro.html
EPTV_RIBEIRÃO_PRETO,0,Abertos,551,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=551
EPTV_CAMPINAS_GLOBO_BH_e_CURITIBA,0,Abertos,556,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=556
RBS_RS,0,Abertos,557,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=557
TV_TEM_BAURU_SJRIOPRETO,0,Abertos,546,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=546
TV_TEM_SOROCABA,0,Abertos,550,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=550
TV_TRIBUNA_SANTOS,0,Abertos,562,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=562
TV_VANGUARDA_MEGA_TV,0,Abertos,561,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=561
TV_VERDES_MARES,0,Abertos,554,http://www.sky.com.br/guiadatv/canais/canal.aspx?__qsCanal=554
SBT,1,Abertos,768,http://www.sbt.com.br/programacao
), Channels.txt
FileGetSize, Exist, TVGuideBR.ini
If ErrorLevel = 1
{
Fileappend,
(
[Configs]
FontSize=10
FontStyle=bold
FontColor1=White
FontColor2=Lime
Synopsis=No
[Data]
GradeDate=%A_dd%/%A_MM%
ni=33
nc=33
), TVGuideBR.ini
}
}
Return
First:
{
Gui, 4: + Toolwindow +Alwaysontop
Gui, 4: Color, Black
Gui, 4: Font, cLime s12
Gui, 4: Add, Text, x10 y10,
(
Obrigado por usar este programa.
Este programa que exibe a grade de programação de vários canais de tv do Brasil. Os dados são baixados da programadora Sky.
Seu uso é simples:
- O primeiro download dos dados iniciará automaticamente agora. Para baixar os dados clique no botão "Baixar dados";
- O download armazenará dados de quatro dias de programação (dia baixado + 3 dias futuros);
- Dias anteriores estarão disponíveis somente quando o download foi em algum dos três dias anteriores;
- A lista de canais é personalizável (aba "Config");
- Os canais são categorizados (Filmes, Seriados, Cultura, News, Esportes, Infantis, Abertos e Div (não categorizados);
- Marcadores: "=" marca a hora atual; "-" marca uma hora a menos e uma hora a mais da hora atual; e "+" marca as horas 20, 21 e 22;
- Os botões ">" contem opções e detalhes do programa selecionado (abrir online, sinopse, novas exibições, revisão do programa etc);
- Deixe uma idéia ou comentário no forum deste programa;
- Contribua com donativos se desejar (luetkmeyer@yahoo.com.br). Bom proveito.
)
Gui, 4: Show, Autosize Center, Iniciando...
}
Return
; Others functions
Guiclose:
GuiEscape:
exitapp
Return
2Guiclose:
2GuiEscape:
SetTimer, DownloadAddSyn, Off
Gui, 2: Destroy
WinSet, Transparent, OFF, TVGuideBR (
WinActivate, TVGuideBR (
Return
; scroll
GuiSize:
UpdateScrollBars(A_Gui, A_GuiWidth, A_GuiHeight)
return
#IfWinActive ahk_group MyGui
WheelUp::
WheelDown::
+WheelUp::
+WheelDown::
; SB_LINEDOWN=1, SB_LINEUP=0, WM_HSCROLL=0x114, WM_VSCROLL=0x115
loop, 10
OnScroll(InStr(A_ThisHotkey,"Down") ? 1 : 0, 0, GetKeyState("Shift") ? 0x114 : 0x115, WinExist())
return
#IfWinActive
UpdateScrollBars(GuiNum, GuiWidth, GuiHeight)
{
static SIF_RANGE=0x1, SIF_PAGE=0x2, SIF_DISABLENOSCROLL=0x8, SB_HORZ=0, SB_VERT=1
Gui, %GuiNum%:Default
Gui, +LastFound
; Calculate scrolling area.
Left := Top := 9999
Right := Bottom := 0
WinGet, ControlList, ControlList
Loop, Parse, ControlList, `n
{
GuiControlGet, c, Pos, %A_LoopField%
if (cX < Left)
Left := cX
if (cY < Top)
Top := cY
if (cX + cW > Right)
Right := cX + cW
if (cY + cH > Bottom)
Bottom := cY + cH
}
Left -= 8
Top -= 8
Right += 8
Bottom += 8
ScrollWidth := Right-Left
ScrollHeight := Bottom-Top
; Initialize SCROLLINFO.
VarSetCapacity(si, 28, 0)
NumPut(28, si) ; cbSize
NumPut(SIF_RANGE | SIF_PAGE, si, 4) ; fMask
; Update horizontal scroll bar.
;NumPut(ScrollWidth, si, 12) ; nMax
;NumPut(GuiWidth, si, 16) ; nPage
;DllCall("SetScrollInfo", "uint", WinExist(), "uint", SB_HORZ, "uint", &si, "int", 1)
; Update vertical scroll bar.
; NumPut(SIF_RANGE | SIF_PAGE | SIF_DISABLENOSCROLL, si, 4) ; fMask
NumPut(ScrollHeight, si, 12) ; nMax
NumPut(GuiHeight, si, 16) ; nPage
DllCall("SetScrollInfo", "uint", WinExist(), "uint", SB_VERT, "uint", &si, "int", 1)
if (Left < 0 && Right < GuiWidth)
x := Abs(Left) > GuiWidth-Right ? GuiWidth-Right : Abs(Left)
if (Top < 0 && Bottom < GuiHeight)
y := Abs(Top) > GuiHeight-Bottom ? GuiHeight-Bottom : Abs(Top)
if (x || y)
DllCall("ScrollWindow", "uint", WinExist(), "int", x, "int", y, "uint", 0, "uint", 0)
}
OnScroll(wParam, lParam, msg, hwnd)
{
static SIF_ALL=0x17, SCROLL_STEP=10
bar := msg=0x115 ; SB_HORZ=0, SB_VERT=1
VarSetCapacity(si, 28, 0)
NumPut(28, si) ; cbSize
NumPut(SIF_ALL, si, 4) ; fMask
if !DllCall("GetScrollInfo", "uint", hwnd, "int", bar, "uint", &si)
return
VarSetCapacity(rect, 16)
DllCall("GetClientRect", "uint", hwnd, "uint", &rect)
new_pos := NumGet(si, 20) ; nPos
action := wParam & 0xFFFF
if action = 0 ; SB_LINEUP
new_pos -= SCROLL_STEP
else if action = 1 ; SB_LINEDOWN
new_pos += SCROLL_STEP
else if action = 2 ; SB_PAGEUP
new_pos -= NumGet(rect, 12, "int") - SCROLL_STEP
else if action = 3 ; SB_PAGEDOWN
new_pos += NumGet(rect, 12, "int") - SCROLL_STEP
else if (action = 5 || action = 4) ; SB_THUMBTRACK || SB_THUMBPOSITION
new_pos := wParam>>16
else if action = 6 ; SB_TOP
new_pos := NumGet(si, 8, "int") ; nMin
else if action = 7 ; SB_BOTTOM
new_pos := NumGet(si, 12, "int") ; nMax
else
return
min := NumGet(si, 8, "int") ; nMin
max := NumGet(si, 12, "int") - NumGet(si, 16) ; nMax-nPage
new_pos := new_pos > max ? max : new_pos
new_pos := new_pos < min ? min : new_pos
old_pos := NumGet(si, 20, "int") ; nPos
x := y := 0
if bar = 0 ; SB_HORZ
x := old_pos-new_pos
else
y := old_pos-new_pos
; Scroll contents of window and invalidate uncovered area.
DllCall("ScrollWindow", "uint", hwnd, "int", x, "int", y, "uint", 0, "uint", 0)
; Update scroll bar.
NumPut(new_pos, si, 20, "int") ; nPos
DllCall("SetScrollInfo", "uint", hwnd, "int", bar, "uint", &si, "int", 1)
}
; html
UnHTM( HTM ) { ; Remove HTML formatting / Convert to ordinary text by SKAN 19-Nov-2009
Static HT ; Forum Topic: www.autohotkey.com/forum/topic51342.html
IfEqual,HT,, SetEnv,HT, % "ááââ´´ææàà&ååãã&au"
. "mlä&bdquo„¦¦&bull•ç縸¢¢&circˆ©©¤¤&dagger†&dagger‡°"
. "°÷÷ééêêèèððëë&euro€&fnofƒ½½¼¼¾¾>>&h"
. "ellip…ííîî¡¡ìì¿¿ïï««&ldquo“&lsaquo‹&lsquo‘<<&m"
. "acr¯&mdash—µµ··  &ndash–¬¬ññóóôô&oeligœòò&or"
. "dfªººøøõõöö¶¶&permil‰±±££"""»»&rdquo”®"
. "®&rsaquo›&rsquo’&sbquo‚&scaronš§§­¹¹²²³³ßßþþ&tilde˜&tim"
. "es×&trade™úúûûùù¨¨üüýý¥¥ÿÿ"
TXT := RegExReplace( HTM,"<[^>]+>" ) ; Remove all tags between "<" and ">"
Loop, Parse, TXT, &`; ; Create a list of special characters
L := "&" A_LoopField ";", R .= (!(A_Index&1)) ? ( (!InStr(R,L,1)) ? L:"" ) : ""
StringTrimRight, R, R, 1
Loop, Parse, R , `; ; Parse Special Characters
If F := InStr( HT, A_LoopField ) ; Lookup HT Data
StringReplace, TXT,TXT, %A_LoopField%`;, % SubStr( HT,F+StrLen(A_LoopField), 1 ), All
Else If ( SubStr( A_LoopField,2,1)="#" )
StringReplace, TXT, TXT, %A_LoopField%`;, % Chr(SubStr(A_LoopField,3)), All
Return RegExReplace( TXT, "(^\s*|\s*$)") ; Remove leading/trailing white spaces
}
|
Updater:
| Code: | #NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance,Force
#NoTrayIcon
Tooltip, Update in progress! Please wait...
Filedelete, %A_ScriptDir%\Channels.txt
Filedelete, %A_ScriptDir%\Grade.txt
Filedelete, %A_ScriptDir%\TVGuideBR.ini
FileDelete, %A_Temp%\TVGuideBR.txt
Filedelete, %A_Temp%\Channels.txt
Filedelete, %A_Temp%\Grade.txt
Filedelete, %A_Temp%\TVGuideBR.ini
Sleep, 1000
FileDelete, TVGuideBR.exe
Sleep, 1000
FileMove, TVGuideBRNew.exe, TVGuideBR.exe, 1
Sleep, 2000
Run, TVGuideBR.exe
Tooltip
Exitapp
|
Last edited by luetkmeyer on Sat Jul 02, 2011 3:53 am; edited 77 times in total |
|