It's our post notifier bot I just wrote, along with a few features I should probably write (based on Eeems' EeeZorBot framework).
Features
- Notifies of posts made on CodeWalrus
- Provides services to the IRC channels
How it works
The forum software simply sends an UDP packet to the bot which posts it on IRC. Probably the simplest and the fastest way so it won't lag at all. I chose UDP because it's a connectionless protocol, unlike TCP.
Restart
Should you have the need restart it (which I doubt), it's pretty much the same way as OmnomIRC (it could probably be converted as a systemd service if you want). Look for something like "js lib/main.js" or "npm start", kill it, cd to where the bot is (currently in my homedir) and type "npm start" in a screen.
Code
If you guys want to write a mod, I'll post the current diff here:
--- Subs-Post.php~ 2014-12-17 21:38:52.494808188 +0000
+++ Subs-Post.php 2014-12-19 01:14:23.910808189 +0000
@@ -2032,6 +2032,15 @@
if ($msgOptions['approved'])
updateLastMessages($topicOptions['board'], $new_topic || !empty($topicOptions['is_approved']) ? $msgOptions['id'] : 0);
+ // Send this to IRC
+ if(!in_array($topicOptions['board'], array(2, 12)))
+ {
+ $ircsocket = stream_socket_client('udp://127.0.0.1:33333');
+ $sendstr = "PRIVMSG #CodeWalrus :\x0310New ".($new_topic?"topic":"post")." by \x0304".html_entity_decode($posterOptions['name'])."\x0310 on \x0303".html_entity_decode($msgOptions['subject'])."\x0310 http://codewalr.us/".$topicOptions['id']."/".$msgOptions['id'];
+ stream_socket_sendto($ircsocket, $sendstr);
+ fclose($ircsocket);
+ }
+
// Alright, done now... we can abort now, I guess... at least this much is done.
ignore_user_abort($previous_ignore_user_abort);
The diff is for both /Sources/Subs-Post.php and /mobiquo/include/Subs-Post.php (because Tapatalk copied the file in its own directory or I dunno).
For the bot plugins I added, it's here: https://github.com/juju2143/EeeZorBot-scripts
Current bugs
- Doesn't hide the staff board
- Tapatalk fixed!
- No customization other than modifying the code directly
- No topic length limit (it probably shouldn't be annoying but we can always add it if it's a problem, just tell me)
- Some commands are still experimental and can crash the bot
Have fun. :P
Ok thanks for the tip. It should make it easier to upgrade until we get a mod of this. :)
I doubt topic lenght should be an issue, because of the short URLs.
I think nicknames should be made color-less or medium gray, though (there's an IRC character for that that is not black), because right now it might look too much like a ripoff of Omnimaga post notifications (we use the same color scheme). Green is fine, though, because the site mainly uses green anyway)
Hmmm nice. You might wanna consider moving it to freenode though once we have a better botnet.
It should connect to all three networks, but I still have to figure out why it's not connecting to Omninet and Freenode. Once it's figured out the post notifier will move to Omninet.
Good luck juju x.x
Ah ok that's cool. :)
She's on all three networks now. Also, if you want me to implement some features to her, like Google/DDG/CodeWalrus search, output the title of an URL or even improvments to the post notifier, please tell me and I'll try to work on them over the Xmas vacations.
Yay it works!
Should I take WalTopic down now?
Keep a copy in case we ever have major issues with the bot we got right now, though.
Why not name it YuukiBot as a reference to SAO2 :P
Ideally it should be named CodeWalrus or ^New and the post notifications made so that they use the /me command, so that way they are shorter. Eg they should probably look like this:
* CodeWalrus post by DJ Omnimaga in Walrification begins monday! http://codewalr.us/56/1946
Quote from: aeTIos on December 19, 2014, 07:48:11 AM
Why not name it YuukiBot as a reference to SAO2 :P
Because it's a reference to Haruhi Suzumiya. (And because I mostly always use Yuki as a character name, but yeah, Haruhi.)
Quote from: DJ Omnimaga on December 19, 2014, 12:05:59 PM
Ideally it should be named CodeWalrus or ^New and the post notifications made so that they use the /me command, so that way they are shorter. Eg they should probably look like this:
* CodeWalrus post by DJ Omnimaga in Walrification begins monday! http://codewalr.us/56/1946
That's an idea.
Hmmm does it sync topics (with omnom too) ? Cause iirc omnom topic syncing doesn't work.
If you mean the /topic command, then it won't sync unless the bot has ops in the channel. But again maybe it's broken. :P
It's on GitHub! Also new page title thingy.
https://github.com/juju2143/EeeZorBot-scripts
I see EeeZor in the title, which is Eeems-related. Did you use any code of his in this bot and did you ask him permission before re-using it? I don't want to have the same issues as with the recent posts mod.
He strongly encourages the use of his framework for my IRC bot needs, and I did not modified anything other than the config (I update it once in a while) and my own plugins I dumped in the scripts folders using his API, so I guess it's okay? He probably still doesn't know it's used on the CodeWalrus channel, though. Should probably tell him next time I see him. Pretty sure he'd be happy I'm writing code for it anyway.
I guess it probably depends of the license and who made it. Considering you are contribiting to it it should prbly be fine, tho.
The bot now have a search engine! Use .cw <search query>.
Yay now for ddg search (since the stupid google API is gone)
DDG search is not implemented yet. That one uses MySQL.
Would there be a workaround for Google?
Yep. And it's already implemented. \o/
So far:
.cw: Searches posts on CodeWalrus (uses some obscure function in MySQL)
.google: Google Search (does not use the API!)
.calc: Calculator! (Uses Wolfram Alpha's API)
Also:
<Yuki> .calc the game
<YukiBot> [calc] You just lost.
Cool to hear. You should probably make a topic elsewhere on the forum that other people can see that documents the Google trick in case other members would like to fix their respective bots. I am curious about what workaround was used as well.
That's really cool and also document that google trick so I can steal your code but in Java for my bot on ##FRC on Freenode.
In short it just scrapes the webpage for results.
https://github.com/jprichardson/node-google
Wait what does it screen the entire CW website in order to find results? O.O I hope you meant Google page, else the bandwidth usage...
Yeah I meant Google. For CW it queries the MySQL server.
Oh ok phew lol.
Also should this topic be moved to public? (you could always create another topic in the staff board or update pimath's topic on how to restart the bot when needed)
Yeah I guess. Wasn't sure since it contains some instructions to the staff, but nothing inportant. Should prolly move those infos in another topic.
Yeah I thought it would actually be best to have all the bot restart and SMF code change info in one topic so it's easier to find. We only have two minor code changes, but losing track of them would make it very hard to upgrade in the future. And knowing how to restart the bots would be nice since sometimes Omninet and EFnet crap themselves out, causing most bots to disconnect.
Juju: Fix, pl0x.
Quote03:12:17 <@WalriiBot> (O)* DJ_Omnimaga has changed the topic to Hangout for http://codewalr.us fans (TI-84+, Nspire, HP Prime, Mobile, Music and Art board) | Rules http://codewalr.us/36 | Last week of privateness! (Opening Jan 1st 2015) | https://www.facebook.com/CodeWalrusFans | https://twitter.com/codewalr_us
03:12:17 @WalriiBot set the topic: Hangout for http://codewalr.us fans (TI-84+, Nspire, HP Prime, Mobile, Music and Art board) | Rules http://codewalr.us/36 | Last week of privateness! (Opening Jan 1st 2015) | https://www.facebook.com/CodeWalrusFans | https://twitter.com/codewalr_us
03:12:17 <@WalriiBot> (E)<YukiBot> [title] Login
03:12:17 <@WalriiBot> (E)<YukiBot> [title] Login
03:12:18 <@WalriiBot> (E)<YukiBot> [title] Login
03:12:18 <@WalriiBot> (E)<YukiBot> [title] Login
03:12:27 <@WalriiBot> (O)<DJ_Omnimaga> fail
This is actually the expected behavior. You posted 4 URLs in the same line, it posted 4 times the title. Although the titles for the Facebook and Twitter pages shouldn't probably say "Login"...
EDIT: Well, stupid me. It was actually a bug. It's fixed now.
EDIT2: Wait, nope. This is pretty weird.
Quote from: IRCYuki Hangout for http://codewalr.us fans (TI-84+, Nspire, HP Prime, Mobile, Music and Art board) | Rules http://codewalr.us/36 | Last week of privateness! (Opening Jan 1st 2015) | https://www.facebook.com/CodeWalrusFans | https://twitter.com/codewalr_us
YukiBot [title] Login
YukiBot [title] Login
YukiBot [title] Update Your Browser | Facebook
YukiBot [title] Update Your Browser | Facebook
Yuki https://www.facebook.com/CodeWalrusFans | https://twitter.com/codewalr_us
YukiBot [title] Update Your Browser | Facebook
YukiBot [title] Update Your Browser | Facebook
Yuki https://twitter.com/codewalr_us
YukiBot [title] CodeWalrus (@Codewalr_us) | Twitter
Yuki what
Yuki https://twitter.com/codewalr_us https://www.facebook.com/CodeWalrusFans
YukiBot [title] Update Your Browser | Facebook
YukiBot [title] Update Your Browser | Facebook
To be honest I don't like this feature much if it's gonna spam everytime we post URLs. Youtube, Cemetech, CW (perhaps Omni too if they ever get rid of PrettyURL for new topics) and some other page link descriptions are fine but I think it should either just detect the first link or put the description in one line. Not to mention when many links are posted this will become a mess anyway.
Well I can always limit it to the first link if it's too annoying.
The other idea would be to make it so it merges 2-4 descriptions at a time into one line (depending of how long they are).
Also we need a way to get the staff to use IRC more because right now they are very active on Telegram but not IRC. Either find an OmnomIRC alternative, such as modifying SimplePortal shoutbox then making a bot to relay IRC to the site and vice-versa, port SAX to SMF (independent from #cemetech of course, so that we can use our own rules) or find a way to get rid of ISP-specific Omnom lag (which isn't likely, seeing as even Omnimaga has lag too, from time to time).
Or we could get a bot to relay the Telegram channel to IRC, if that's not against Telegram rules, and encourage staff to use the staff board for site issues. The latter option would also show post notifications on Telegram, which might give Street some incentive to post on weekends instead of spending 24 hours straight customizing one of his 79 tablets and phones. :P
Hmmm btw, I thought about posting this : I can't filter yukibot highlights like I do with new in #omnimaga because I'm on freenode and muting her highlights means muting every highlight coming from omnom/efnet/omninet. It'd be cool to make omnom not relay her messages and have her post on each network instead.
Personally I'm against disallowing post notifications on OmnomIRC. If we get a working shoutbox at one point this would defeat the point of having post notifications in the first place, as most of our users would use OmnomIRC, and it would reduce activity a lot.
What I think is that we should probably find a way to make Omnom not highlight when Yukibot posts or make it so that it intentionally misspells everyone's nickname (eg S t r e e t w a l r u s instead of Streetwalrus).
I don't want to hurt CW activity just because one person is annoyed that the bot highlights him.
That said, I think the URL title feature should be put in a separate bot, though, so we can ignore both features separately.
I meant relaying across networks, not on the shoutbox.
Ok but I would still like post notifications to show up everywhere.
I think you misunderstood me. I said that yukibot should handle cross network herself instead of relying on omnom for that.
Oh ok, I thought you wanted post notifications on on OmnomIRC removed entirely O.O (that's what the OmnomIRC /ignore command is for)
Do you know when this bot will be back up on IRC? I don't know if Withg ZNC services will ever come back so it might be wise to move the bot elsewhere
She's always been on the CW server, without a ZNC.
Oh ok but any idea why it's not online right now or at least why it lacks ops on EFnet?
Something is wrong with Yukibot. Everytime a new post is made it says the post page title >.<
* Walrified post by Eiyeron on Re: Walrii fanart http://codewalr.us/38/7472 6:09:03 PM
YukiBot [title] Walrii fanart 6:09:03 PM
* Walrified post by Cumred_Snektron on Re: Walrii fanart http://codewalr.us/38/7473 6:09:38 PM
YukiBot [title] Walrii fanart 6:09:38 PM
* Walrified post by Streetwalrus on Re: Raspberry Pi based GameCube modchip http://codewalr.us/59/7474 6:16:11 PM
YukiBot [title] Raspberry Pi based GameCube modchip 6:16:11 PM
* Walrified post by Streetwalrus on Re: Librecalc is dead Big Frown http://codewalr.us/327/7475 6:17:54 PM
YukiBot [title] Librecalc is dead Big Frown 6:17:54 PM
* Walrified post by Streetwalrus on Re: Pi day! http://codewalr.us/320/7476 6:18:53 PM
YukiBot [title] Pi day! 6:18:54 PM
* Walrified post by Cumred_Snektron on Re: Librecalc is dead Big Frown http://codewalr.us/327/7477
Must be because I moved Walrified to OmniNet.
Ah that might explain it. It seems fixed now. Not that this was a serious issue, but if there are activity spikes this would have cluttered the chat very bad.
Yeah but such a filter should be easy to do, right?
Yeah it was in place when the bots were on efnet.
Ah right, it was because the bot was on a different side of our IRC channel. :P It probably just thought Walrified was WalriiBot :P
Something that should probably be fixed:
(http://img.codewalr.us/topictitles.png)
As demonstrated above and I witnessed it in the past (although obviously not as exaggerated :P), YukiBot reporting the post title instead of topic title can lead to confusion.
Hey look mineprime has a blue walrii ^.^ (the topic #404)
Yeah that was confusing for me but rarely do people change the post title
I only change it if something monumental happens. :P
aka 1337 posts :P
Yes, just that once :P
Yeah, you can do that, and I'd probably vote to make it stay that way, but you definitely shouldn't abuse it.
What I thought too. ;)
That could work. It just gets a bit confusing sometimes. Also alexgt it wasn't the blue walrus but rather (http://codewalr.us/omnomirc_www/smileys/rainbowwalrii3b.gif)
Oh, that one is better still :P
I think it could go a little faster, then be better :P
Nah, because on some LCDs the motion blur would make it look like it is actually slower or not moving much :P.
Quote from: DJ Omnimaga on July 17, 2015, 10:50:01 PM
Nah, because on some LCDs the motion blur would make it look like it is actually slower or not moving much :P.
Like my kindle :P
The guy on fire in the other thread went about .5 miles per hour. :P