MEET? WAS: [Mpls-pm] Working with objects returned by functions in Inline::Python

Matthew Johnson matt at omega.org
Wed Jul 14 15:48:52 CDT 2004


Ok, so.  I know one of you perl jockeys out there on the list can help  
Ian with his external method call problem.  I can't because I don't  
understand such things because I'm not a perl jockey yet, I just clean  
the stables.

Maybe we could discuss it over coffee... hint hint... like actual  
in-person conversation? Hmmm interesting concept, what is your  
implementation look like?

On Jul 14, 2004, at 9:30 AM, Ian Malpass wrote:

> I'm doing some stuff with RSS aggregation, and I'd like to use Mark
> Pilgrim's 'liberal' feed parser[0] (because XML::RSS is annoying me).  
> The
> parser is written in python, but my app is built in perl. Much as I'd  
> like
> to (a) learn python and (b) rewrite the whole app, I thought I'd try to
> use Inline::Python instead.
>
> feedparser.py has a parse method, which returns an object which I  
> *think*
> is an instance of FeedParserDict. I can get feedparser loaded, and I  
> can
> call parse, but I get an Inline::Python object back which I've no idea  
> how
> to use.
>
> The docs suggest
>
>>> import feedparser
>>> d = feedparser.parse('http://feedparser.org/docs/examples/atom.xml')
>>> d['feed']['title']
>> u'Sample Feed'
>
> although it does look like d.feed.title would also work.
>
> However, if I run the following:
>
>   #!/usr/bin/perl -w
>   use Inline Python => 'from feedparser import parse';
>   $f = parse("http://www.indecorous.com/golb/golb.rss");
>   print $f->feed();
>
> I get "Attempted to call non-method 'feed'".
>
> I've tried importing the class FeedParserDict too but that hasn't  
> helped.
>
> So, how do I access the results of calling parse?
>
> Thanks,
>
> Ian
>
> [0] <http://feedparser.org/>
>
> -
> --
> ----------------------------------------------------------------------- 
> -
>
> The soul would have no rainbows if the eyes held no tears.
>
> Ian Malpass                     ian at indecorous.com
>
> _______________________________________________
> Mpls-pm mailing list
> Mpls-pm at pm.org
> http://www.pm.org/mailman/listinfo/mpls-pm




More information about the Mpls-pm mailing list