Top News Bot code

Platform:  mIRC
Published  Oct 23, 2008
Updated  Jun 21, 2011
copy/paste into a new remote of ur bot.
!UPDATED!

<~napa182> @news u 1
<&Sick0> Us News: Story Number: 1 : U.S. releases graphic tobacco warning labels : WASHINGTON (Reuters) - Dead bodies, diseased lungs and a man on a ventilator were among the graphic images for revamped U.S. tobacco labels, unveiled on Tuesday by health officials who hope the warnings will help smokers quit.

<~napa182> @news w 1
<&Sick0> World News: Story Number: 1 : Seven protesters killed in Syria during rallies : AMMAN (Reuters) - Syrian security forces shot dead seven people on Tuesday during clashes in two cities between President Bashar al-Assad's loyalists and protesters demanding his removal, a leading activist said.

<~napa182> @news t 1
<&Sick0> Technology News: Story Number: 1 : Analysis: New Internet rules will spawn battle for "dots" : NEW YORK (Reuters) - When it comes to branding on the Internet, 2012 may be the dawn of a chaotic new era with companies and other groups expected to battle over suffixes like .cancer, .chocolate and just about .anything.

<~napa182> @news p 1
<&Sick0> Politics News: Story Number: 1 : Biden, Congress tee up crucial week on debt limit : WASHINGTON (Reuters) - Faced with a looming self-imposed deadline, lawmakers launched a crucial week of debt-reduction talks on Tuesday seeking to break through differences on taxes and healthcare.

<~napa182> @news s 1
<&Sick0> Sports News: Story Number: 1 : Serena shows raw emotion while Federer wins : LONDON (Reuters) - Wimbledon has come to expect fighting instincts and effortless power from Serena Williams but the raw tears she shed after beating Aravane Rezai Tuesday betrayed just how much torment she has suffered since holding the trophy aloft last year.

<~napa182> @news e 1
<&Sick0> Entertainment News: Story Number: 1 : John Galliano to attend anti-Semitic trial : PARIS (Reuters) - Fashion designer John Galliano will attend in person his trial on Wednesday over charges he hurled anti-Semitic insults at customers in a cafe in a series of outbursts that have wrecked a towering career.

<~napa182> @news h 1
<&Sick0> Health News: Story Number: 1 : U.S. releases graphic tobacco warning labels : WASHINGTON (Reuters) - Dead bodies, diseased lungs and a man on a ventilator were among the graphic images for revamped U.S. tobacco labels, unveiled on Tuesday by health officials who hope the warnings will help smokers quit.

<~napa182> @news o 1
<&Sick0> Oddlyenough News: Story Number: 1 : Boeing rights a wrong: the flight attendant button : LE BOURGET, France (Reuters) - In the long history of bad industrial design, the flight attendant call button on commercial airlines takes a prominent place.



feel free to rip butcher and strip this code how ever you want idc

pulls US, World, Technology, Politics, Entertainment, Health, Sports, and OddlyEnough News


on $*:text:/^@news?\s?([uwtpehso])?\s?(\d+)?/iS:#: {
if (!$regml(1) || !$regml(2) || $regml(2) >= 11) { msg # To Get $iif($regml(1) = u,US,$iif($regml(1) = w,World,$iif($regml(1)t,Technology,$iif($regml(1) = p,Politics,$iif($regml(1) = e,Entertainment,$iif($regml(1) = h,Health,$iif($regml(1) = s,Sports,$iif($regml(1) = o,OddlyEnough, $&
$iif(!$istok(u w t p e h s o,$regml(1),32),US / World / Technology / Politics / Entertainment / Health / Sports / OddlyEnough,))))))))) News Please type @news $iif($regml(1) = u,<u>,$iif($regml(1) = w,<w>,$iif($regml(1) = t,<t>,$iif($regml(1) = p,<p>,$iif($regml(1) = e,<e>,$iif($regml(1) = h,<h>, $&
$iif($regml(1) = s,<s>,$iif($regml(1) = o,<o>,$iif(!$istok(u w t p e h s o,$regml(1),32),<uwtpehso>,))))))))) $&
< number of news story > 1-10 ex: @news $iif(!$istok(u w t p e h s o,$regml(1),32),t,$regml(1)) 3 }
else {
if ($sock(news)) sockclose news
sockopen news www.reuters.com 80
sockmark news $iif($regml(1) = u,us,$iif($regml(1) = w,world,$iif($regml(1) = t,technology,$iif($regml(1) = p,politics,$iif($regml(1) = e,entertainment,$iif($regml(1) = h,health,$iif($regml(1) = s,sports,$iif($regml(1) = o,oddlyEnough)))))))) $regml(2) msg #
}
}
on *:sockopen:news: {
sockwrite -n $sockname GET $+(/news/,$gettok($sock(news).mark,1,32)) HTTP/1.1
sockwrite -n $sockname Host: $+($sock(news).addr,$str($crlf,2))
}
on *:sockread:news: {
var %news | sockread %news
if ($regex(%news,/(<h1>|<h2>)<a href="/article.+>(.+)<\/a>$/)) { inc -u4 %nf
if (%nf = $gettok($sock(news).mark,2,32)) {
sockmark news $addtok($sock(news).mark,04 $+($upper($left($gettok($sock(news).mark,1,32),1)),$&
$lower($right($gettok($sock(news).mark,1,32),-1))) News: Story Number: $gettok($sock(news).mark,2,32) :  $regml(2) :,32)
}
}
if ($regex(%news,/(<\/h2><p>|<p>)(.+)(<\/p>|\|&nbsp;)/) && %nf = $gettok($sock(news).mark,2,32)) {
$gettok($sock(news).mark,3-,32) $replace($regml(2),&amp;,&)
sockclose news
}
}

Comments

Sign in to comment.
cptpan   -  Oct 23, 2013
This suddenly stopped pulling news?
cptpan  -  Jan 21, 2014
Working again, must of been the original website.
Sign in to comment

Jethro   -  May 20, 2011
You have to wire 20Gs into napa182's Swiss offshore bank account before he'll be interested. jk. lol
 Respond  
napa182   -  May 20, 2011
um prob not at this time, but if you want you can make one for the UK.
 Respond  
toclafane1   -  May 18, 2011
this is good but is there any chance of there being a uk 1 aswell
 Respond  
Lucius   -  Sep 20, 2010
Any chance of a UK version too?
pretty please?
:]
 Respond  
bourneident   -  Sep 20, 2010
Hey bro any chance you can add canadian news to this
 Respond  
napa182   -  Aug 25, 2010
joehaglund use this one to notice
Code
 
 Respond  
joehaglund   -  Aug 25, 2010
i can't get the notice $user $chan to work... ive tried it with notice $nick $chan as well..
any help?
 Respond  
Quick   -  Jun 22, 2010
Napa, nice work. No more papers for me or breaking my neck to see the tv while im at my desk xD
 Respond  
Hobo123   -  May 07, 2010
Hmm, somehow the world section is not showing.

Edit: nevermind I was stupid.
 Respond  
Hobo123   -  May 07, 2010
Holy crap that was fast O_o
 Respond  
napa182   -  May 07, 2010
added world news to it
 Respond  
Hobo123   -  May 07, 2010
Well done Napa, but I was thinking of trying to do an international news Newsbot, but my programming skills are limited.

I will try my best xD
 Respond  
GTAXL   -  Mar 23, 2010
ohh. Ok. The trigger was @news, not !news. hmm. I just wish it would post the news automaticly now..
 Respond  
napa182   -  Mar 23, 2010
GTAXL Said:
What's the trigger? I've tried news and !update, !UPDATED, and !UPDATED. None work


GTAXL did you bother to read the description? if you did you would have seen an example on how to trigger the socket.

copy/paste into a new remote of ur bot.

<~napa182> @news u 1
<&Sick0> Us News: Story Number: 1 : At least 5 dead in Connecticut power plant blast : MIDDLETOWN, Connecticut (Reuters) - At least five people were killed and 12 injured on Sunday when a massive explosion rocked a large gas-fired power plant being built in Middletown, Connecticut, the town's mayor said.

<~napa182> @news
<&Sick0> To Get US / Technology / Politics / Entertainment / Health / Sports / OddlyEnough News Please type @news <utpehso> < number of news story > 1-10 ex: @news t 3

<~napa182> @news u
<&Sick0> To Get US News Please type @news <u> < number of news story > 1-10 ex: @news u 3


GTAXL Said:
can I change the news host? Will it post news automaticly?


if you are going to change the site i used then you may as well make a new socket script an make sure you have the right html line to pull from. Also no it will not post news automatically cuz that tends to get annoying.
 Respond  
GTAXL   -  Mar 22, 2010
What's the trigger? I've tried news and !update, !UPDATED, and !UPDATED. None work and can I change the news host? Will it post news automaticly?
 Respond  
napa182   -  Feb 14, 2010
lol so true.... i started posting that after i have found my scripts posted on other sites.
if they are going to rip them there is nothing really you can do, but call them out on it.
 Respond  
Jethro   -  Feb 14, 2010
feel free to rip butcher and strip this code how ever you want idc
Nice fine print, but you don't have to encourage them rippers really.
They're very, very "self-motivated."
 Respond  
napa182   -  Feb 14, 2010
it still works fine for me. are you still using the old code? cuz i have updated it so maybe you should use the updated version of it.


<~napa182> @news u 1
<&Sick0> Us News: Story Number: 1 : ConocoPhillips' Alaska head dies in avalanche : ANCHORAGE (Reuters) - The president of ConocoPhillips Alaska was killed in an avalanche and a colleague who was part of his snowmobiling party was missing and presumed dead, Alaska State Troopers told Reuters.

<~napa182> @news t 1
<&Sick0> Technology News: Story Number: 1 : Google mulls stand-alone version of Buzz : SAN FRANCISCO (Reuters) - Google Inc said it may create a stand-alone version of its Buzz social networking product but won't separate Buzz from its Gmail service, a linkup that has spurred controversy over privacy.


still works fine for me...
 Respond  
Goddess420   -  Feb 14, 2010
Hey napa, just wanted to tell you that your webpage for this scpirt has been change and doesn't bring up the news anymore
 Respond  
VinX   -  Feb 08, 2010
awesome ... thanks napa ... :D
 Respond  
napa182   -  Feb 08, 2010
ok i got around to updating this script.. @ Al_Bundy33 it's @news u 1
to Get US / Technology / Politics / Entertainment / Health / Sports / OddlyEnough News Please type @news <utpehso> < number of news story > 1-10 ex:
<~napa182> @news u 1
<&Sick0> Us News: Story Number: 1 : Mardi Gras in Miami as Saints win first Super Bowl : MIAMI (Reuters) - The New Orleans Saints completed their long-awaited transformation from chumps to champions by defeating the Indianapolis Colts 31-17 in the Super Bowl on Sunday to claim their first NFL title.

<~napa182> @news t 3
<&Sick0> Technology News: Story Number: 3 : China shuts down largest hacker training website : SHANGHAI (Reuters) - China has closed what it claims to be the largest hacker training website in the country and arrested three of its members, domestic media reported on Monday.
 Respond  
Al_Bundy33   -  Jul 20, 2009
hey napa , what would the code be for the us news one? im not good at coding , sorry :)
 Respond  
Automotive   -  Jun 17, 2009
Not very hard to modify it. Notice $chan $nick
 Respond  
Automotive   -  Jun 17, 2009
CoOlEsT_n_CuTeSt I hope you are not joking.
 Respond  
k0ji   -  Jun 16, 2009
:P
 Respond  
napa182   -  Jun 16, 2009
@k0ji you may as well make a new script for that site. I would do it, but i cant read indonesian. =/
 Respond  
k0ji   -  Jun 16, 2009
how to edit for webside information. i live from indonesia. in indonesia detik.com is news favorite information
 Respond  
^Alexis^   -  Nov 27, 2008
GOOD
 Respond  
CoOlEsT_n_CuTeSt   -  Nov 24, 2008
hey i want that news in a notice not msg so please tell me how to do it.. and please if u can message me this in my inbox please send the snippet in a message
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.