You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

YukiBot

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0
b/[Completed] CodeWalrus Tools (Web/Android/PC) publicado por u/Yuki December 17, 2014, 11:03:21 PM
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
Last Edit: December 23, 2014, 05:48:55 PM by Juju
Inicia sesión o crea una cuenta para dejar un comentario
u/Dream of Omnimaga December 18, 2014, 07:00:04 AM
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)
Last Edit: December 18, 2014, 07:03:53 AM by DJ Omnimaga
u/novenary December 18, 2014, 12:20:58 PM
Hmmm nice. You might wanna consider moving it to freenode though once we have a better botnet.
u/Yuki December 18, 2014, 03:03:35 PM
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.
u/Dream of Omnimaga December 18, 2014, 05:43:59 PM
Good luck juju x.x
u/novenary December 18, 2014, 06:56:16 PM
Ah ok that's cool. :)
u/Yuki December 19, 2014, 03:15:19 AM
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.
u/pimathbrainiac December 19, 2014, 03:38:29 AM
Yay it works!

Should I take WalTopic down now?
u/Dream of Omnimaga December 19, 2014, 03:52:25 AM
Keep a copy in case we ever have major issues with the bot we got right now, though.
u/aetios December 19, 2014, 07:48:11 AM
Why not name it YuukiBot as a reference to SAO2 :P
u/Dream of Omnimaga 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
u/Yuki December 19, 2014, 03:24:17 PM
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.
u/novenary December 21, 2014, 09:15:17 PM
Hmmm does it sync topics (with omnom too) ? Cause iirc omnom topic syncing doesn't work.
u/Dream of Omnimaga December 21, 2014, 09:58:18 PM
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
u/Yuki December 22, 2014, 07:05:42 AM
It's on GitHub! Also new page title thingy.

https://github.com/juju2143/EeeZorBot-scripts
Start a Discussion

b/[Completed] CodeWalrus Tools (Web/Android/PC)

The sub-forum for WalrusIRC, an IRC-linked shoutbox, as well as DarkestEx and Cumred_Snektron's post notifiers. Other major site browsing tools might be discussed here when applicable.

17
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal