Thread

Posted on Wed Apr 12 00:48:44 2006 by sbrady
Modify Profile
Is there anyway to modify my profile via WWW::Myspace ?? Any help is greatly appreciated! Thanks! - Sean
Direct Responses: 2153 | Write a response
Posted on Wed Apr 12 10:43:33 2006 by grantg in response to 2151
Re: Modify Profile
No way to modify your profile via WWW::Myspace yet. If you know Perl and would like to help write it, let me know. :) Grant
Direct Responses: 2155 | Write a response
Posted on Thu Apr 13 03:50:30 2006 by sbrady in response to 2153
Re: Modify Profile
Hello Grant. Okay, I've got it working.... here's the code I'm using.... it needs to be made more generic of course.... but I thought I'd send it to you anyhow.... you can either throw it in and modify it.... or let me know, and I'll try to get to it! Oh, and right now it only modifies the about me section, but of course that can be generisized... just had to get it together quickly for a single purpose app. Thanks - Sean
## follow the Edit Profile link $mech->get("http://editprofile.myspace.com/index.cfm?fuseaction=profile.interests"); ## submit edit interests form my $edit_interest_fields = { interestLabel => 'aboutme' }; _submit_form(2, $edit_interest_fields); ## submit edit interests preview form my $edit_preview_fields = { interestLabel => 'aboutme', interest => $content }; _submit_form(2, $edit_preview_fields); ## final submit my $edit_final_fields = { interestLabel => 'aboutme', interest => $content }; _submit_form(2, $edit_final_fields); return 1; } sub _submit_form { my ($form_number, $fields) = @_; $mech->form_number($form_number); $mech->set_fields(%{$fields}); $mech->current_form; my $result = $mech->submit(); if ($result->content() =~ /\berror\b/i) {die new Sink::Error("MySpace", "ERROR")} return 1; }
Direct Responses: 2156 | 2160 | Write a response
Posted on Thu Apr 13 06:03:08 2006 by jimmy in response to 2155
Re: Modify Profile
awesome job cant wait to see this integrated somwhow!!
Write a response
Posted on Thu Apr 13 19:35:50 2006 by grantg in response to 2155
Re: Modify Profile
Thanks Sean, that's great. I'm finishing up a substantial re-org of the module and the tests, hopefully I'll be able to integrate this soon. - Grant
Write a response