Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Twitter CPAN distribution.

Report information

Subject: New feature?
Date: Thu, 15 Mar 2007 21:54:34 +0100
To: bug-net-twitter [...] rt.cpan.org
From: Fabrizio Pivari <fabrizio [...] pivari.com>

Message body is not shown because sender requested not to inline it.

Download fpivari
image/png 1.1k
fpivari
You will have to be more specific than "It doesn't seem to work". I suspect that any utf8 handling will be done inside Twitter, but I can't be sure without knowing exactly what it is you're experiencing.
Subject: Re: [rt.cpan.org #25475] New feature?
Date: Mon, 19 Mar 2007 19:24:05 +0100
To: bug-Net-Twitter [...] rt.cpan.org
From: Fabrizio Pivari <fabrizio [...] pivari.com>

Message body is not shown because sender requested not to inline it.

Download fpivari
image/png 1.1k
fpivari
I am unable to recreate this. By using the included setstatus.pl and grabbing the first title from your RSS feed, I do: $result = $twit->update("TESTING UTF-8: Nasce l'ALM 2.0: è ora di upgrade!"); In case that doesn't come through RT, the letter before ora is an &egrave; http://www.mathmlcentral.com/characters/glyphs/EGrave.html You can see the results of this on the new Net::Twitter twitter profile: http://twitter.com/net_twitter The response returned from twitter from this submission includes: 'text' => 'TESTING UTF-8: Nasce l\'ALM 2.0: \\u00e8 ora di upgrade!', u00e8 is the correct unicode entry for egrave. Can you provide a code example that does not function?
Subject: Re: [rt.cpan.org #25475] New feature?
Date: Tue, 20 Mar 2007 14:02:44 +0100
To: bug-Net-Twitter [...] rt.cpan.org
From: Fabrizio Pivari <fabrizio [...] pivari.com>
#!/usr/bin/perl # # Require Perl5 # # rss2twitter -- RSS to Twitter # # by Pivari.com <info@pivari.com> 25th April 2007 # # This is version 0.1 # # blogger to twitter use strict; use Getopt::Long; use HTTP::Lite; use Net::Twitter; use XML::RSS; # use Encode; # sourceforge # GUI # Donazioni # -user e -password # con user crea un file di appoggio dove memorizzare gli articoli # Caricamento rss # estrazione titolo e link # conversione caratteri accentati # pubblicazione my $version="0.1"; my $producer="rss2twitter"; my $rss2twitterHome="http://www.pivari.com/$producer.html"; my $configure=$producer.".cfg"; my $help=0; my $verbose=0; my $Version; my $debug=0; my $match=0; my $prhase; my $companyname="Pivari.com"; my $PIVARImail="mailto:info\@pivari.com"; my $elem; my @option; my @elem; my $temp; my $newtemp; my $phrase; my $result; &GetOptions("configure=s" => \$configure, "help" => \$help, "version" => \$Version, "verbose" => \$verbose, "debug" => \$debug) || printusage() ; my @elem=("user","password","feed"); my %option=(user => '', password => '', feed => ''); $debug and $verbose=1; if($Version) {print "$producer $version\n";exit;} $help and printusage(); if (-e $configure) { $verbose and print "Processing $configure configuration file\n"; open (CNF, "$configure"); while (<CNF>) { s/\t/ /g; #replace tabs by space s/ *$//g; #delete blanks at the end of the line next if /^ *\#/; #ignore comment lines next if /^ *$/; #ignore empty lines foreach $elem (@elem) { if (/ *$elem *: *(.*)/i) { $option{$elem}=$1; $verbose and print "$elem is set\t\t$option{$elem}\n"; } } } close(CNF); } else { &Warning("to set your $producer configuration file you can use:\n$producer.cfg or -configure your_$producer.cfg\nElse the program will use the default parameters\n-default to see the default parameters\n") } my $http = new HTTP::Lite; my $req = $http->request("$option{'feed'}") or die "Unable to get document: $!"; $debug and print "Downloading $option{'feed'}\n"; $debug and print $http->body(); my $rss = new XML::RSS; $rss->parse($http->body()); my $file= $option{'user'}.".r2t"; my $twit = Net::Twitter->new(username=>$option{'user'}, password=>$option{'password'}); foreach my $item (@{$rss->{'items'}}) { next unless defined($item->{'title'}) && defined($item->{'link'}); if (-e $file) { $match=0; open (FILE, "$file") || die "$producer: couldn't read file $file\n"; while (<FILE>) { $temp=$item->{'title'}; # $temp=&SpecChars($item->{'title'}); # if (/$item->{'link'}: $temp/) {$match=1} if (/$item->{'link'}/) {$match=1} } close(FILE); if($match eq 0) { $phrase="$item->{'link'} $item->{'title'} "; $verbose and print "$phrase\n"; $result = $twit->update($phrase); } } else { $phrase="$item->{'link'} $item->{'title'}"; $verbose and print "$phrase\n"; $result = $twit->update($phrase); } } open (FILE, ">$file") || die "$producer: couldn't create file $file\n"; foreach my $item (@{$rss->{'items'}}) { next unless defined($item->{'title'}) && defined($item->{'link'}); $temp=$item->{'title'}; # $temp=&UTFiso($temp); # $newtemp = decode("utf8", $temp), # $temp = encode("cp1250", $newtemp); # $temp=&SpecChars($temp); print FILE "$item->{'link'}: $temp\n"; } close(FILE); sub SpecChars { my $string = shift(@_); $string=~s/&/&amp;/g; $string=~s/'/&#39;/g; $string=~s/"/&#34;/g; $string=~s/ñ/&#241;/g; $string=~s/à/&#224;/g; $string=~s/è/&#232;/g; $string=~s/ì/&#236;/g; $string=~s/ò/&#242;/g; $string=~s/ù/&#249;/g; $string=~s/á/&#225;/g; $string=~s/é/&#233;/g; $string=~s/í/&#237;/g; $string=~s/ó/&#243;/g; $string=~s/ú/&#250;/g; $string=~s/â/&#226;/g; $string=~s/ê/&#234;/g; $string=~s/î/&#238;/g; $string=~s/ô/&#244;/g; $string=~s/û/&#251;/g; $string=~s/ä/&#228;/g; $string=~s/ë/&#235;/g; $string=~s/ï/&#239;/g; $string=~s/ö/&#246;/g; $string=~s/ü/&#252;/g; $string=~s/ã/&#227;/g; $string=~s/õ/&#245;/g; $string=~s/“/&#8220;/g; $string=~s/”/&#8221;/g; $string=~s/‘/&#8212;/g; $string=~s/’/&#8217;/g; $string=~s/®/&#174;/g; return $string; } # UTF-8 to iso-8859-1 sub UTFiso { my $string = shift(@_); $string=~s/à/à/g; $string=~s/è/è/g; $string=~s/é/é/g; $string=~s/ò/ò/g; $string=~s/ù/ù/g; $string=~s/ì/ì/g; $string=~s/’/’/g; $string=~s/‘/‘/g; $string=~s/°/°/g; $string=~s/®/®/g; $string=~s/™/™/g; return $string; } sub printusage { print <<USAGEDESC; usage: $producer [-options ...] where options include: -help print out this message -configure file default $producer.cfg -version the program version -verbose verbose Home: $rss2twitterHome USAGEDESC exit(1); } exit 0; # __END__ =head1 NAME RSS2Twitter - Version 1.0 25th April 2007 =head1 SYNOPSIS Syntax : rss2twitter [-options] =head1 DESCRIPTION rss2twitter To introduce the title and the link of the posts in a RSS into Twitter =head1 Features RSS2TWITTER =head1 Options where options include: -help print out this message -configure file default txt2pdf.cfg -version the program version -verbose verbose =cut

Message body is not shown because sender requested not to inline it.

Download fpivari
image/png 1.1k
fpivari
Resolving this as it's too old to be relevant. Current versions pass UTF8 through to twitter without problem in testing.