Skip to content

Instantly share code, notes, and snippets.

import XMonad
import System.IO
import qualified XMonad.StackSet as W
import Data.Ratio ((%))
import XMonad.Actions.Commands
import XMonad.Hooks.DynamicLog
event ircd_daemon_nick => sub {
my ($self, $sender, $nick) = @_[OBJECT, SENDER, ARG0];
$self->log->debug("[ircd_daemon_nick] $nick");
# if it's a nick change, we only get ARG0 and ARG1
return unless defined $_[ARG2];
return if $nick eq $self->irc_botname;
sub twitter {
my ($self, $method, @args) = @_;
my $r = eval { $self->_twitter->$method(@args) };
if ( $@ ) {
if ( blessed $@ && $@->can('code') && $@->code == 502 ) {
$@ = 'Fail Whale';
}
$self->twitter_error("$method -> $@");
}
### The model ####
package MyApp::Model::Twitter;
use Moose;
use Carp;
use Net::Twitter;
use namespace::autoclean;
extends 'Catalyst::Component';
__PACKAGE__->config(
How do I get Twitter to display something other than "from Perl Net::Twitter"?

If you set the source paramter to api, twitter will display "from API", and if you set it to the empty string, twitter will display, "from web".

$nt = Net::Twitter->new(netrc=>1,legacy=>0,ssl=>1,source=>'api');
$nt->update('A post with the source parameter overridden.');

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 1:

=over without closing =back

package BMT::URI::Find;
use parent 'URI::Find';
use Regexp::Common qw/balanced/;
# subclass of URI::Find to handle URIs like:
#
# http://en.wikipedia.org/wiki/Scala_(programming_language)
#
sub decruft {
my ( $self, $orig_match ) = @_;
#!/user/bin/env perl
# HOWTO - Net::Twitter with OAuth in perl scripts
#
# Register an OAuth app with twitter:
# http://dev.twitter.com/apps
#
# Note the consumer key and consumer secret.
#
# On your app page, select "My Access Token"
#
package Net::Twitter::Role::OAuth::Netrc::Credentials;
use Moose::Role;
use Carp;
use Net::Netrc;
=head1 SYNOPSIS
use Net::Twitter;
my $nt = Net::Twitter->new(
package Net::Twitter::Error;
use Moose;
use namespace::autoclean;
use Try::Tiny;
use Devel::StackTrace;
use Scalar::Util qw/reftype/;
use overload '""' => \&error,,
'fallback' => 1;
#!/usr/bin/perl
#
# Net::Twitter - OAuth desktop app example
#
use warnings;
use strict;
use Net::Twitter;
use Data::Dumper;