29 Haziran 2016, 18:29
|
#1 |
Çevrimiçi | Haberler TCL Kod: Kodu kopyalamak için üzerine çift týklayýn! #####################
## MANSET HABERLER ##
## BY RASCOLN ##
#####################
### habersitesi
set haber "https://www.haberler.com/gunun-mansetleri/"
### haber kanalý
set hbkanal "#kanaladi"
### Kaç dakikada bir haberler gosterilsin
set hbtime "5"
### Ýlk haberin gösterileceði saniye
utimer 20[list haberler]
proc haberler {} {
set x 0
set zaman [timer $::hbtime[list haberler]]
set randNum [expr { int(30 * rand()) }]
catch { exec curl -vk $::haber } data
while { [regexp -- {<div style=\"margin-bottom: 5px;\"><strong><a href=\"(.*?)\" title=\".*?\"><font color=\"black\" size=\"4\">.*?<\/font><\/a><\/strong><\/div>(.*)$} $data -> link data] } {
if {$x == 30} { break }
if {"$x" == "$randNum"} {
set ::linkx $link
break
}
incr x
}
catch { exec curl -vk $::linkx } habercix
if { [regexp -- {<h1 itemprop=\"headline\" id=\"haber_baslik\" class=\" \">(.*?)<\/h1>} $habercix - baslik] } {
putquick "privmsg $::hbkanal :--------------------------------------------------------------------------------"
putquick "privmsg $::hbkanal :\002MANSET HABERLERI :\002"
largetext privmsg $::hbkanal "\002BASLIK:\002\0034 [string map -nocase {"°" "Ý" "ÄŸ" "ð" "Ä°" "i" "ç" "ç" "ı" "ý" "ü" "ü" "ÅŸ" "þ" "^ž" "Þ" "ö" "ö"} $baslik]\003"
}
if {![info exists baslik]} { killtimer $zaman; timer 1[list haberler]; return 0 }
if {[regexp -- { <span class=\"nav1\"><meta itemprop=\"datePublished\" content=\".*?\">(.*?)<\/span>} $habercix - tsaat] } {
largetext privmsg $::hbkanal "\002Haber Tarihi ve Saati:\002\0034 [string map -nocase {"T" " " "+" " " "\"" "" "°" "Ý" "ÄŸ" "ð" "Ä°" "i" "ç" "ç" "ı" "ý" "ü" "ü" "ÅŸ" "þ" "^ž" "Þ" "ö" "ö"} $tsaat]\003"
} elseif { [regexp -- {<meta itemprop=\"datePublished\" content=\"(.*?)\">} $habercix - tsaat] } {
largetext privmsg $::hbkanal "\002Haber Tarihi ve Saati:\002\0034 [lrange [string map -nocase {"T" " " "+" " " "\"" "" "°" "Ý" "ÄŸ" "ð" "Ä°" "i" "ç" "ç" "ı" "ý" "ü" "ü" "ÅŸ" "þ" "^ž" "Þ" "ö" "ö"} [lindex $tsaat 0]] 0 1]\003"
}
if {![info exists tsaat]} { killtimer $zaman; timer 1[list haberler]; return 0 }
regexp -- {<h2 itemprop=\"description\" class=\"ustblkgenislet2 spot \">(.*?)<\/h2>} $habercix - haberler
largetext privmsg $::hbkanal "[string map { "^" "Þ" } [string map {"id=\"oroll\"" "" "<div" "" "<h2 itemprop=\"description\" class=\"ustblkgenislet2 spot \">" "" "°" "Ý" "ÄŸ" "ð" "Ä°" "i" "ç" "ç" "ı" "ý" "ü" "ü" "ÅŸ" "þ" "ö" "ö"} $haberler]]"
largetext privmsg $::hbkanal "\002HABER DETAYI:\002 \0033$::linkx \003"
putquick "privmsg $::hbkanal :--------------------------------------------------------------------------------"
}
proc largetext {type target text {delims {" "•,.!?}}} {
set lineLen [expr {412 - [string length ":$::botname $type [join $target] :\r\n"]}]
if {[string length $text] <= $lineLen} {
putquick "$type $target :[entityToChar $text]"
return 0
}
set _text [split [entityToChar $text] $delims]
set x 0
set i 0
while {$x < $lineLen} {
if {$i >= [llength $_text]} {
return 0
}
set wordlen [string length [lindex $_text $i]]
if {$x + $wordlen > $lineLen} {
break
}
incr x $wordlen
incr x
incr i
}
putquick "$type $target :[string range [entityToChar $text] 0 [expr {$x - 1}]]"
largetext $type $target [string trimleft [string range [entityToChar $text] $x end]] $delims
}
proc entityToChar {text {char utf-8}} {
if {![string match *&* $text]} {return $text}
set escapes {
\xa0 ¡ \xa1 ¢ \xa2 £ \xa3 ¤ \xa4
¥ \xa5 ¦ \xa6 § \xa7 ¨ \xa8 © \xa9
ª \xaa « \xab ¬ \xac * \xad ® \xae
¯ \xaf ° \xb0 ± \xb1 ² \xb2 ³ \xb3
´ \xb4 µ \xb5 ¶ \xb6 · \xb7 ¸ \xb8
¹ \xb9 º \xba » \xbb ¼ \xbc ½ \xbd
¾ \xbe ¿ \xbf À \xc0 Á \xc1 Â \xc2
à \xc3 Ä \xc4 Å \xc5 Æ \xc6 Ç \xc7
È \xc8 É \xc9 Ê \xca Ë \xcb Ì \xcc
Í \xcd Î \xce Ï \xcf Ð \xd0 Ñ \xd1
Ò \xd2 Ó \xd3 Ô \xd4 Õ \xd5 Ö \xd6
× \xd7 Ø \xd8 Ù \xd9 Ú \xda Û \xdb
Ü \xdc Ý \xdd Þ \xde ß \xdf à \xe0
á \xe1 â \xe2 ã \xe3 ä \xe4 å \xe5
æ \xe6 ç \xe7 è \xe8 é \xe9 ê \xea
ë \xeb ì \xec í \xed î \xee ï \xef
ð \xf0 ñ \xf1 ò \xf2 ó \xf3 ô \xf4
õ \xf5 ö \xf6 ÷ \xf7 ø \xf8 ù \xf9
ú \xfa û \xfb ü \xfc ý \xfd þ \xfe
ÿ \xff ƒ \u192 Α \u391 Β \u392 Γ \u393 Δ \u394
Ε \u395 Ζ \u396 Η \u397 Θ \u398 Ι \u399
Κ \u39A Λ \u39B Μ \u39C Ν \u39D Ξ \u39E
Ο \u39F Π \u3A0 Ρ \u3A1 Σ \u3A3 Τ \u3A4
Υ \u3A5 Φ \u3A6 Χ \u3A7 Ψ \u3A8 Ω \u3A9
α \u3B1 β \u3B2 γ \u3B3 δ \u3B4 ε \u3B5
ζ \u3B6 η \u3B7 θ \u3B8 ι \u3B9 κ \u3BA
λ \u3BB μ \u3BC ν \u3BD ξ \u3BE ο \u3BF
π \u3C0 ρ \u3C1 ς \u3C2 σ \u3C3 τ \u3C4
υ \u3C5 φ \u3C6 χ \u3C7 ψ \u3C8 ω \u3C9
ϑ \u3D1 ϒ \u3D2 ϖ \u3D6 • \u2022
… \u2026 ′ \u2032 ″ \u2033 ‾ \u203E
⁄ \u2044 ℘ \u2118 ℑ \u2111 ℜ \u211C
™ \u2122 ℵ \u2135 ← \u2190 ↑ \u2191
→ \u2192 ↓ \u2193 ↔ \u2194 ↵ \u21B5
⇐ \u21D0 ⇑ \u21D1 ⇒ \u21D2 ⇓ \u21D3 ⇔ \u21D4
∀ \u2200 ∂ \u2202 ∃ \u2203 ∅ \u2205
∇ \u2207 ∈ \u2208 ∉ \u2209 ∋ \u220B ∏ \u220F
∑ \u2211 − \u2212 ∗ \u2217 √ \u221A
∝ \u221D ∞ \u221E ∠ \u2220 ∧ \u2227 ∨ \u2228
∩ \u2229 ∪ \u222A ∫ \u222B ∴ \u2234 ∼ \u223C
≅ \u2245 ≈ \u2248 ≠ \u2260 ≡ \u2261 ≤ \u2264
≥ \u2265 ⊂ \u2282 ⊃ \u2283 ⊄ \u2284 ⊆ \u2286
⊇ \u2287 ⊕ \u2295 ⊗ \u2297 ⊥ \u22A5
⋅ \u22C5 ⌈ \u2308 ⌉ \u2309 ⌊ \u230A
⌋ \u230B ⟨ \u2329 ⟩ \u232A ◊ \u25CA
♠ \u2660 ♣ \u2663 ♥ \u2665 ♦ \u2666
" \x22 & \x26 < \x3C > \x3E O&Elig; \u152 œ \u153
Š \u160 š \u161 Ÿ \u178 ˆ \u2C6
˜ \u2DC   \u2002   \u2003   \u2009
‌ \u200C ‍ \u200D ‎ \u200E ‏ \u200F – \u2013
— \u2014 ‘ \u2018 ’ \u2019 ‚ \u201A
“ \u201C ” \u201D „ \u201E † \u2020
‡ \u2021 ‰ \u2030 ‹ \u2039 › \u203A
€ \u20AC ' \u0027 ‎ "" ‏ "" ? "" * ""
* ""
};
set text [string map[list "\]" "\\\]" "\[" "\\\[" "\$" "\\\$" "\\" "\\\\"] [string map $escapes $text]]
regsub -all -- {&#([[:digit:]]{1,5});} $text {[format %c [string trimleft "\1" "0"]]} text
regsub -all -- {&#x([[:xdigit:]]{1,4});} $text {[format %c [scan "\1" %x]]} text
return [subst "$text"]
}
putlog "manset haber by rascoLn" Kod: Kodu kopyalamak için üzerine çift týklayýn! #####################
## MANSET HABERLER ##
## BY RASCOLN ##
#####################
### habersitesi
set haber "https://www.haberler.com/gunun-mansetleri/"
### haber kanalý
set hbkanal "#kanaladi"
### Kaç dakikada bir haberler gosterilsin
set hbtime "5"
### Ýlk haberin gösterileceði saniye
utimer 20[list haberler]
proc haberler {} {
set x 0
set zaman [timer $::hbtime[list haberler]]
set randNum [expr { int(30 * rand()) }]
catch { exec curl -vk $::haber } data
while { [regexp -- {<div style=\"margin-bottom: 5px;\"><strong><a href=\"(.*?)\" title=\".*?\"><font color=\"black\" size=\"4\">.*?<\/font><\/a><\/strong><\/div>(.*)$} $data -> link data] } {
if {$x == 30} { break }
if {"$x" == "$randNum"} {
set ::linkx $link
break
}
incr x
}
catch { exec curl -vk $::linkx } habercix
if { [regexp -- {<h1 itemprop=\"headline\" id=\"haber_baslik\" class=\" \">(.*?)<\/h1>} $habercix - baslik] } {
putquick "privmsg $::hbkanal :--------------------------------------------------------------------------------"
putquick "privmsg $::hbkanal :\002MANSET HABERLERI :\002"
largetext privmsg $::hbkanal "\002BASLIK:\002\0034 [string map -nocase {"°" "Ý" "ÄŸ" "ð" "Ä°" "i" "ç" "ç" "ı" "ý" "ü" "ü" "ÅŸ" "þ" "^ž" "Þ" "ö" "ö"} $baslik]\003"
}
if {![info exists baslik]} { killtimer $zaman; timer 1[list haberler]; return 0 }
if {[regexp -- { <span class=\"nav1\"><meta itemprop=\"datePublished\" content=\".*?\">(.*?)<\/span>} $habercix - tsaat] } {
largetext privmsg $::hbkanal "\002Haber Tarihi ve Saati:\002\0034 [string map -nocase {"T" " " "+" " " "\"" "" "°" "Ý" "ÄŸ" "ð" "Ä°" "i" "ç" "ç" "ı" "ý" "ü" "ü" "ÅŸ" "þ" "^ž" "Þ" "ö" "ö"} $tsaat]\003"
} elseif { [regexp -- {<meta itemprop=\"datePublished\" content=\"(.*?)\">} $habercix - tsaat] } {
largetext privmsg $::hbkanal "\002Haber Tarihi ve Saati:\002\0034 [lrange [string map -nocase {"T" " " "+" " " "\"" "" "°" "Ý" "ÄŸ" "ð" "Ä°" "i" "ç" "ç" "ı" "ý" "ü" "ü" "ÅŸ" "þ" "^ž" "Þ" "ö" "ö"} [lindex $tsaat 0]] 0 1]\003"
}
if {![info exists tsaat]} { killtimer $zaman; timer 1[list haberler]; return 0 }
regexp -- {<h2 itemprop=\"description\" class=\"ustblkgenislet2 spot \">(.*?)<\/h2>} $habercix - haberler
largetext privmsg $::hbkanal "[string map { "^" "Þ" } [string map {"id=\"oroll\"" "" "<div" "" "<h2 itemprop=\"description\" class=\"ustblkgenislet2 spot \">" "" "°" "Ý" "ÄŸ" "ð" "Ä°" "i" "ç" "ç" "ı" "ý" "ü" "ü" "ÅŸ" "þ" "ö" "ö"} $haberler]]"
largetext privmsg $::hbkanal "\002HABER DETAYI:\002 \0033$::linkx \003"
putquick "privmsg $::hbkanal :--------------------------------------------------------------------------------"
}
proc largetext {type target text {delims {" "•,.!?}}} {
set lineLen [expr {412 - [string length ":$::botname $type [join $target] :\r\n"]}]
if {[string length $text] <= $lineLen} {
putquick "$type $target :[entityToChar $text]"
return 0
}
set _text [split [entityToChar $text] $delims]
set x 0
set i 0
while {$x < $lineLen} {
if {$i >= [llength $_text]} {
return 0
}
set wordlen [string length [lindex $_text $i]]
if {$x + $wordlen > $lineLen} {
break
}
incr x $wordlen
incr x
incr i
}
putquick "$type $target :[string range [entityToChar $text] 0 [expr {$x - 1}]]"
largetext $type $target [string trimleft [string range [entityToChar $text] $x end]] $delims
}
proc entityToChar {text {char utf-8}} {
if {![string match *&* $text]} {return $text}
set escapes {
\xa0 ¡ \xa1 ¢ \xa2 £ \xa3 ¤ \xa4
¥ \xa5 ¦ \xa6 § \xa7 ¨ \xa8 © \xa9
ª \xaa « \xab ¬ \xac * \xad ® \xae
¯ \xaf ° \xb0 ± \xb1 ² \xb2 ³ \xb3
´ \xb4 µ \xb5 ¶ \xb6 · \xb7 ¸ \xb8
¹ \xb9 º \xba » \xbb ¼ \xbc ½ \xbd
¾ \xbe ¿ \xbf À \xc0 Á \xc1 Â \xc2
à \xc3 Ä \xc4 Å \xc5 Æ \xc6 Ç \xc7
È \xc8 É \xc9 Ê \xca Ë \xcb Ì \xcc
Í \xcd Î \xce Ï \xcf Ð \xd0 Ñ \xd1
Ò \xd2 Ó \xd3 Ô \xd4 Õ \xd5 Ö \xd6
× \xd7 Ø \xd8 Ù \xd9 Ú \xda Û \xdb
Ü \xdc Ý \xdd Þ \xde ß \xdf à \xe0
á \xe1 â \xe2 ã \xe3 ä \xe4 å \xe5
æ \xe6 ç \xe7 è \xe8 é \xe9 ê \xea
ë \xeb ì \xec í \xed î \xee ï \xef
ð \xf0 ñ \xf1 ò \xf2 ó \xf3 ô \xf4
õ \xf5 ö \xf6 ÷ \xf7 ø \xf8 ù \xf9
ú \xfa û \xfb ü \xfc ý \xfd þ \xfe
ÿ \xff ƒ \u192 Α \u391 Β \u392 Γ \u393 Δ \u394
Ε \u395 Ζ \u396 Η \u397 Θ \u398 Ι \u399
Κ \u39A Λ \u39B Μ \u39C Ν \u39D Ξ \u39E
Ο \u39F Π \u3A0 Ρ \u3A1 Σ \u3A3 Τ \u3A4
Υ \u3A5 Φ \u3A6 Χ \u3A7 Ψ \u3A8 Ω \u3A9
α \u3B1 β \u3B2 γ \u3B3 δ \u3B4 ε \u3B5
ζ \u3B6 η \u3B7 θ \u3B8 ι \u3B9 κ \u3BA
λ \u3BB μ \u3BC ν \u3BD ξ \u3BE ο \u3BF
π \u3C0 ρ \u3C1 ς \u3C2 σ \u3C3 τ \u3C4
υ \u3C5 φ \u3C6 χ \u3C7 ψ \u3C8 ω \u3C9
ϑ \u3D1 ϒ \u3D2 ϖ \u3D6 • \u2022
… \u2026 ′ \u2032 ″ \u2033 ‾ \u203E
⁄ \u2044 ℘ \u2118 ℑ \u2111 ℜ \u211C
™ \u2122 ℵ \u2135 ← \u2190 ↑ \u2191
→ \u2192 ↓ \u2193 ↔ \u2194 ↵ \u21B5
⇐ \u21D0 ⇑ \u21D1 ⇒ \u21D2 ⇓ \u21D3 ⇔ \u21D4
∀ \u2200 ∂ \u2202 ∃ \u2203 ∅ \u2205
∇ \u2207 ∈ \u2208 ∉ \u2209 ∋ \u220B ∏ \u220F
∑ \u2211 − \u2212 ∗ \u2217 √ \u221A
∝ \u221D ∞ \u221E ∠ \u2220 ∧ \u2227 ∨ \u2228
∩ \u2229 ∪ \u222A ∫ \u222B ∴ \u2234 ∼ \u223C
≅ \u2245 ≈ \u2248 ≠ \u2260 ≡ \u2261 ≤ \u2264
≥ \u2265 ⊂ \u2282 ⊃ \u2283 ⊄ \u2284 ⊆ \u2286
⊇ \u2287 ⊕ \u2295 ⊗ \u2297 ⊥ \u22A5
⋅ \u22C5 ⌈ \u2308 ⌉ \u2309 ⌊ \u230A
⌋ \u230B ⟨ \u2329 ⟩ \u232A ◊ \u25CA
♠ \u2660 ♣ \u2663 ♥ \u2665 ♦ \u2666
" \x22 & \x26 < \x3C > \x3E O&Elig; \u152 œ \u153
Š \u160 š \u161 Ÿ \u178 ˆ \u2C6
˜ \u2DC   \u2002   \u2003   \u2009
‌ \u200C ‍ \u200D ‎ \u200E ‏ \u200F – \u2013
— \u2014 ‘ \u2018 ’ \u2019 ‚ \u201A
“ \u201C ” \u201D „ \u201E † \u2020
‡ \u2021 ‰ \u2030 ‹ \u2039 › \u203A
€ \u20AC ' \u0027 ‎ "" ‏ "" ? "" * ""
* ""
};
set text [string map[list "\]" "\\\]" "\[" "\\\[" "\$" "\\\$" "\\" "\\\\"] [string map $escapes $text]]
regsub -all -- {&#([[:digit:]]{1,5});} $text {[format %c [string trimleft "\1" "0"]]} text
regsub -all -- {&#x([[:xdigit:]]{1,4});} $text {[format %c [scan "\1" %x]]} text
return [subst "$text"]
}
putlog "manset haber by rascoLn" |
| |
IRCForumu.Net - Reklam Alaný |
|