delicious.php 628 B

1234567891011121314151617181920212223242526
  1. <?php
  2. class Keyring_Service_Delicious extends Keyring_Service_HTTP_Basic {
  3. const NAME = 'delicious';
  4. const LABEL = 'delicious.com';
  5. function __construct() {
  6. parent::__construct();
  7. $this->set_endpoint( 'verify', 'https://api.del.icio.us/v1/posts/update', 'GET' );
  8. $this->requires_token( true );
  9. }
  10. function _get_credentials() {
  11. return false;
  12. }
  13. function parse_response( $data ) {
  14. return simplexml_load_string( $data );
  15. }
  16. function get_display( Keyring_Access_Token $token ) {
  17. return $token->get_meta( 'username' );
  18. }
  19. }
  20. add_action( 'keyring_load_services', array( 'Keyring_Service_Delicious', 'init' ) );