Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

an arrayref to an array of hashref

  • 27-05-2012 5: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