Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

an arrayref to an array of hashref

  • 27-05-2012 05:08PM
    #1
    Registered Users, Registered Users 2 Posts: 760 ✭✭✭


    I want to control a lego mindstroms robto via twitter, i using identi.ca to test it as it uses the same API as twitter and user the old oauth system, Net::Identica, is part of Net::Twitter.

    Can some point me in the right direction on how to just isolate the the text from the last update sent to the account .Attache is the output of the script.

    From the errors I got messing with the code and API it returns an arrayref to an array of hashref.
    I've only had limted experiance with perl only accesing Mysql DBs, I'm not sure what they are and how they work. I did do some serching and looked at exameles but they weren't realy any help .
    
    #!/usr/bin/perl  
    use Net::Identica;
    use Time::Local;
    use Data::Dumper;
    
    
    $host="192.168.1.1";
    $user='machie';
    $passwd='qwert'; #not my real password 
    
    $nt = Net::Identica->new(username => $user, password => $passwd);
    $results = $nt->user_timeline();
    $r= Dumper($results);
    
    
    print $r;
    


Comments

  • Registered Users, Registered Users 2 Posts: 1,477 ✭✭✭azzeretti


    mach1982 wrote: »
    I want to control a lego mindstroms robto via twitter, i using identi.ca to test it as it uses the same API as twitter and user the old oauth system, Net::Identica, is part of Net::Twitter.

    Can some point me in the right direction on how to just isolate the the text from the last update sent to the account .Attache is the output of the script.

    From the errors I got messing with the code and API it returns an arrayref to an array of hashref.
    I've only had limted experiance with perl only accesing Mysql DBs, I'm not sure what they are and how they work. I did do some serching and looked at exameles but they weren't realy any help .
    
    #!/usr/bin/perl  
    use Net::Identica;
    use Time::Local;
    use Data::Dumper;
    
    
    $host="192.168.1.1";
    $user='machie';
    $passwd='qwert'; #not my real password 
    
    $nt = Net::Identica->new(username => $user, password => $passwd);
    $results = $nt->user_timeline();
    $r= Dumper($results);
    
    
    print $r;
    

    What are you trying to retrieve? I don't see any 'last update' key in the text you supplied. Do you know how to dereference arrays and hashes on their own (one level)? It's really just an extension of that, although it can be a complete head fúck to begin with.


  • Registered Users, Registered Users 2 Posts: 760 ✭✭✭mach1982


    azzeretti wrote: »
    What are you trying to retrieve? I don't see any 'last update' key in the text you supplied. Do you know how to dereference arrays and hashes on their own (one level)? It's really just an extension of that, although it can be a complete head fúck to begin with.

    I think the key is 'text',

    I don't know how to to deference arrays and hashes, but now I have something I search for , so thanks.

    Let you all know how it goes.


  • Registered Users, Registered Users 2 Posts: 1,110 ✭✭✭Skrynesaver


    $results->[0]->{text}
    


  • Registered Users, Registered Users 2 Posts: 760 ✭✭✭mach1982


    $results->[0]->{text}
    

    Knew it was something simple , thanks .


Advertisement