Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


SoylentNews IRC comments feed dispatch filters

Posted by crutchy on Saturday March 21 2015, @11:23PM (#1098)
0 Comments
Code

Our IRC (http://irc.sylnt.us/) has a #comments channel that you can join to see an hourly feed of all new comments that appear in reply to SoylentNews stories.

This has been around for a while, but over the weekend a new feature was added to allow more personalized comment feeds.

Filtered feeds can be dispatched either as a PM to your nick or to a channel of your choosing. To dispatch to a channel you just need to make sure the exec bot resides in that channel (you can command it to join by visiting #soylent and typing "~join #mychannel").

There are two types of filters; cid and pattern

The cid filter is useful if you would like a feed of all responses in a specific comment thread. You simply add a filter that points to the parent comment cid and the bot will feed all child comments that appear.

Using a pattern filter enables you to feed comments that meet certain criteria. There are a number of fields you can match, and any new comment that matches the criteria in a filter will be output to the target nick/channel.

You can add multiple filters to track multiple cid's and/or comments that match multiple patterns.

The following commands can be performed in any channel where the exec bot resides:

~comments filter-add %id% %target% %cid%
~comments filter-add %id% %target% %field% %pattern%
~comments filter-delete %id%
~comments filter-list

%id% = unique name to identify filter (cannot contain spaces)
%target% = channel or nick to send filtered comments to
%cid% = SoylentNews comment id to track ("cid" parameter in uri)
%field% = any of user, uid, score, score_num, subject, title, comment_body (title refers to the story title)
%pattern% = regexp pattern for use with preg_match (surrounding #'s are added by the script)

examples:
- if you wanted a feed for all replies to this comment: http://soylentnews.org/comments.pl?sid=6634&cid=160651
you would use this command:

~comments filter-add my_test_filter #mychannel 160651

- if you wanted a feed with any comments that contain "systemd" you could use this command:

~comments filter-add systemd_filter_1 #mychannel comment_body systemd

and if you also wanted comments with "systemd" in the subject, add another filter:

~comments filter-add systemd_filter_2 #mychannel subject systemd

--
source (unlicensed): https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/comment_feed.php

Bug fixing, one hack at a time (Rehash porting progress)

Posted by NCommander on Friday March 20 2015, @02:56PM (#1096)
3 Comments
Code

Squished an annoying bug in rehash that prevented formkeys working due to changes in how mod_perl works, I dunno worse, the abuse of the MP1 API, or the hack I had to code to emulate the old behavior; here's the comment I left about it:

                # UNBELIEVE HACKINESS AHEAD
                #
                # Ok, under MP1, it was possible to use param as a "semi-persistant" scratchpad
                # that is, to save a new element in the hashref, and get it back by future calls
                #
                # This worked because the older APR methods allowed you to store into the HASREF.
                # even though this behavior was wrong, and bad according to MP documentation. MP2
                # now removed the STORE method from the APR tables so any attempt to write to them
                # goes BANG.
                #
                # Since we can't do that now, we're going to have to fake it. On our first call to
                # getCurrentForm, we'll copy the param tables to a hashref, then shove it into the
                # apache2 pnotes, and then retrieve it on demand.
                #
                # This is a fucking hack, but I can't think of a better way than to refactor a TON of
                # perl, and perl is not a language that makes it easy to refactor ...

Rehash 15.04 progress ...

Posted by NCommander on Monday March 16 2015, @11:29AM (#1082)
0 Comments
Code

Currently deep in working on getting the first rehash (MP2 slashcode) release put together. lithium got rebuilt and is now on the MP2 release. Since this upgrade is disruptive anyone, we decided to go full-in and put in a migration to MySQL cluster as well; which will require some code changes for Search, but otherwise was mostly a drop in upgrade.

My friend Jamie getting an unjust prison term

Posted by Subsentient on Wednesday March 11 2015, @05:48AM (#1069)
10 Comments
/dev/random

I have a friend named Jamie. She's in her 40s, and she might go to prison for four years on the 23rd of this month.
She had a DUI from 2012, which she was guilty of, and one from 2014, which she was not. Because of her prior conviction, she's getting a much harder time by the courts. She's been offered the choice of signing for four years of prison, or taking it to trial and possibly getting 10 years if found guilty. She's a mother with two sweet, young little girls. She won't get to see them for four years. They're going to end up with her mother in Idaho.

She let a friend drive her truck, who was sober, but because she was next to the truck drinking shortly after it parked, she was hit with another DUI when the cops pulled up over a domestic disturbance, which is common here. Her friend already told that she was not the one behind the wheel, but it doesn't seem to make much difference.

Here's where it bothers me. She is innocent, and she's being given the choice of admitting to a crime she didn't commit and getting four years, or fighting it, possibly losing, and getting ten years.

This is disgusting to me.

I'm writing this, I suppose, to ask for advice. How can I help her?

Time is of the essence.

Your Thoughts on the Editorial Process: Editor's Submissions

Posted by n1 on Saturday March 07 2015, @02:03AM (#1060)
11 Comments
Soylent

This editor thinks about things... usually does not reach a conclusion.

Every so often an important story happens, or there are no usable submissions and an editor might elect to circumvent the normal process and set their own story for release. This goes against the normal submissions process, it is not something that happens very often. Site news is the exception to this for obvious reasons.

On the occasions we have released a story as described above -- not waiting for a submission -- there has been no complaints that I am aware of.

Honestly, I do not rush to start releasing my own stories, or to make submissions. Organic and original submissions are far better and what I really want to see more of.

What are your opinions on editors finding and releasing stories this way more often? Especially when it comes to 'breaking news', but more generally also.

[This journal entry is just that, it is not an official SoylentNews RFC or endorsed by any of the staff.]

Autobiography.

Posted by prospectacle on Monday February 23 2015, @11:54AM (#1036)
0 Comments
Hardware

Autobiography: Noun, singular. The story of your first car.

Early autobiographies were short articles within the leisure section of a weekend newspaper, describing the owner's first car, its appearance, price, and the driving experiences it provided.

In the modern era, the genre has become vastly more sophisticated, often running to a length comparable with a novel or automotive repair manual. These book-length autobiographies may include multiple chapters before the car is introduced, setting the background to vehicle ownership, including relevant details from the writer's early life that shape their circumstances, character, and outlook; and inform the important and life-changing choice of first automobile.

The broader effects and transformations that result from having the freedom to drive wherever you want, whenever you want, and the specific limits of this freedom in the individual's case, are then explored in detail. As the genre has become more established and its tropes more familiar and predictable, some authors have chosen to only describe the machine in question indirectly, or by implication.

Later chapters may be set in the period after the car has been sold or given away, focusing on the long term effects the car had on its owner's life. Subsequently purchased cars and the circumstances surrounding their acquisition and use, may be addressed, for the purpose of comparing these eras of the writer's life with the first and most formative experience, which must necessarily act as the standard against which all other times of life are judged.

Books of this genre can today be found in most chain bookstores and car dealerships. They are also available in some of the larger public libraries.

What's coming in the next /code update ...

Posted by NCommander on Saturday February 21 2015, @09:36PM (#1032)
2 Comments
Soylent

I'm just going to leave this here ...

Server: Apache/2.2.29 (Unix) DAV/2 mod_apreq2-20090110/2.8.0 mod_perl/2.0.8 Perl/v5.20.1
X-Powered-By: slashcode 15.01
X-Fry: I'm never gonna get used to the thirty-first century. Caffeinated bacon?

and just say I'm a certifiable madman.

My new distro: Night Linux

Posted by Subsentient on Monday February 16 2015, @11:10PM (#1021)
6 Comments
Code

I've started work (and nearing completion) on a new Linux distro for i586 and up with 64MB of RAM. It's called Night Linux. The origin of the name is a topic for another day.

Night Linux is a small, ~20MB CLI only distro intended for system rescue/utility purposes.
It's the kind of thing you make bootable on your MP3 player to keep with you in a pinch.

Among its features are: Epoch Init System, elinks browser, ircii IRC client, support for mounting and creating/repairing EXT2/3/4, BTRFS, NTFS, and FAT12/16/32 filesystems, ms-sys to repair Windows boot records, GNU parted, syslinux/extlinux along with MBRs in /usr/lib/syslinux for bootloaders, Bricktick brick breaker game, busybox userland, bash 4.3.x, nano editor, OpenSSH, squashfs tools, and more.

Night Linux is based on bleeding edge code with a 3.19 kernel and glibc 2.21.
I haven't published source yet, (waiting to create a project page) but if you want it, I'll provide it upon request.

Get the first alpha here: https://www.dropbox.com/s/9h3wa5ylczjrrt7/NightLinux-Alpha1.i586.iso?dl=1

Feedback welcome.

mini-slashcode-wannabe project

Posted by crutchy on Monday February 16 2015, @09:37PM (#1020)
0 Comments
Code

been mucking around with a little website thing intended to be sort of similar to SoylentNews/Pipedot/etc

it's written in php and is intended to be very simple

site (not yet fully functional) is here: http://news.my.to/

sample story with a bunch of nested test comments here: http://news.my.to/story/1

code for site is here: https://github.com/crutchy-/exec-irc-bot/tree/master/website/news.my.to

so far it has basic rewrite rules, templating for html, uses pdo, no classes (procedural only)

code is unlicensed (https://github.com/crutchy-/exec-irc-bot/blob/master/unlicense.txt)

SubStrings and aqu4bot's improvements from it

Posted by Subsentient on Sunday February 08 2015, @11:55AM (#996)
0 Comments
Code

As of late I've spent some time making improvements to my tiny C string library called SubStrings. There are other string solutions, but those either involve a language such as C++, or they try and create a new string type with a struct or something. In many of my programs, there is a huge amount of text processing. One might say more than you should generally attempt in C. It's not a big problem for me actually. It's becoming even less of a problem since I made my pet projects use SubStrings. As I said, I've recently updated it, but I've added a ton of new functions and features. I've updated aqu4bot to make use of these improvements where available.

Take this example of trying to iterate through lines of text stored in a string in memory
This was extracted from aqu4bot BEFORE I updated to use the new SubStrings functions.
It iterates through each line and forwards them to an IRC user.

Worker = InBuf;
do
{
    while (*Worker == '\r' || *Worker == '\n') ++Worker;

    if (*Worker == '\0') break;

    for (TInc = 0; Worker[TInc] != '\n' && Worker[TInc] != '\r' && Worker[TInc] != '\0' && TInc < sizeof LineBuf - 1; ++TInc)
    {
        LineBuf[TInc] = Worker[TInc];
    }
    LineBuf[TInc] = '\0';

    IRC_Message(SendTo, LineBuf);
} while ((Worker = strpbrk(Worker, "\r\n")));

Hideous, yes?

Thanks to SubStrings, I can shorten it to this:

Worker = InBuf;

while (SubStrings.Line.GetLine(LineBuf, sizeof LineBuf, (const char**)&Worker))
{
    IRC_Message(SendTo, LineBuf);
}

I'll be sifting through aqu4bot's code and updating other components that rely on deranged gerbil magic to get strings to work properly. I'll also be working on SubStrings more.

So far, SubStrings is:
* C89/ANSI with no extensions/platform specific stuff
* Doesn't use ANY library functions, meaning you could build it into your bootloader to make text processing easier.
* Uses a pseudo-OOP function pointer based system for getting functions.
* Is small enough to painlessly be embedded in larger source trees.
* Is public domain (unlicense) software, making it pretty much license neutral.

This should encourage me to add new features to aqu4bot, including making good on my threat of using libcurl to build in email support. Why? Because fuck you.