Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. if(my $delicious_config = MT::PluginData->load({ plugin => 'MT Blogroll', key => 'delicious'.$blog_id })) {
  2. if($delicious_config && $delicious_config->data->{enabled}) {
  3.  
  4. my $username = $delicious_config->data->{username};
  5. my $password = $delicious_config->data->{password};
  6. require Net::Delicious;
  7. my $delicious = Net::Delicious->new({user => $username, pswd => $password });
  8. my %args;
  9. my $tags_joined;
  10. $args{url} = $uri;
  11. $args{description} = $name;
  12. $args{extended} = $desc;
  13. if(defined $tags) {
  14. require MT::Tag;
  15. my $tag_delim = chr($app->user->entry_prefs->{tag_delim});
  16. my @tags = MT::Tag->split($tag_delim, $tags);
  17. $tags_joined = MT::Tag->join(' ', @tags);
  18. }
  19. $args{tags} = $tags_joined || $tags;
  20. $delicious->add_post(\%args);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement