User Tools

Site Tools


reddit

Reddit

A script to submit articles to reddit. Takes you to the reddit submit screen with the url of the page you are on set.

The script

Put this in reddit.pl. Needs URI::Escape

cpan -i URI::Escape
#!/usr/bin/perl                                                                                                                                                                         
 
use strict;
use warnings;
 
use URI::Escape;
 
my $url = $ARGV[5];
$url = uri_escape($url);
$url = "http://www.reddit.com/submit?url=$url";
my $socket = $ARGV[3];
my $sh;
open $sh, '>', $socket or die "Could not open '$socket': $!\n";
print $sh "uri $url\n";
close $sh;

Bindings

I use:

bind    vr        = spawn $XDG_DATA_HOME/uzbl/scripts/reddit.pl
reddit.txt · Last modified: 2016/08/31 14:10 (external edit)