Tag Archive for delicious

check url on delicious

javascript:location.href="<a href="http://delicious.com/url/view?url="%20+%20location.href;

" >http://delicious.com/url/view?url="%20+%20location.href;
source

Delicious ego boost from the command line

lynx --dump <a href="http://delicious.com/tag/noahsussman?setcount=100" >http://delicious.com/tag/noahsussman?setcount=100</a>|grep onemorebug.com|wc -l

source

Delicious API with HTTParty Gem

# From: <a href="http://railstips.org/2008/7/29/it-s-an-httparty-and-everyone-is-invited" >http://railstips.org/2008/7/29/it-s-an-httparty-and-everyone-is-invited</a>
# Author: John Nunemaker

# Delicious API with HTTParty Gem

require 'rubygems'
require 'httparty'

class Delicious
include HTTParty
base_uri 'https://api.del.icio.us/v1'

def initialize(auth)
@auth = auth
end

# query params that filter the posts are:
#   tag (optional). Filter by this tag.
#   dt (optional). Filter by this date (CCYY-MM-DDThh:mm:ssZ).
#   url (optional). Filter by this url.
#   ie: posts(:query => {:tag => 'ruby'})
def posts(options={})
options.merge!({:basic_auth => @auth})
# get posts and convert to structs so we can do .key instead of ['key'] with results
self.class.get('/posts/get', options)
end

# query params that filter the posts are:
#   tag (optional). Filter by this tag.
#   count (optional). Number of items to retrieve (Default:15, Maximum:100).
def recent(options={})
options.merge!({:basic_auth => @auth})
self.class.get('/posts/recent', options)
end
end

# CHANGE USERNAME & PASS !!!
delicious = Delicious.new( :username => 'username', :password => 'password' )
puts delicious.posts(:query => {:tag => 'ruby'}).inspect
puts
puts delicious.recent.inspect

source

get del.icio.us bookmark’s descriptions

require 'net/http'
require 'open-uri'
require 'rubygems'
require 'digest/md5'
require 'rexml/document'

def get_delicious_comments( url )
posts = []
host  = 'feeds.delicious.com'
path  = '/rss/url/' + Digest::MD5.hexdigest( url )
body  = Net::HTTP.start( host, 80 ).get( path ).body
xml   = REXML::Document.new( body )

xml.elements.each('rdf:RDF/item') do |item|
if item.elements['description'].text
post = {
:date => item.elements['dc:date'].text[0..9],
:user => item.elements['dc:creator'].text,
:cmnt => item.elements['description'].text,
:site => "del.icio.us"
}

posts.push( post )
end
end

return posts
end

source

delicious API HTTP Basic Authentication

# Creates a SSL connection with delicious API using the HTTP basic authentication.
# From <a href="http://ruby.about.com/od/tutorials/ss/delicious_tags.htm" >http://ruby.about.com/od/tutorials/ss/delicious_tags.htm</a>
# CHANGE USERNAME & PASS !!!

require 'net/https'
http = Net::HTTP.new('api.del.icio.us', 443)
http.use_ssl = true
http.start do |http|
request = Net::HTTP::Get.new('/v1/tags/get')
request.basic_auth 'username', 'password'
response = http.request(request)
response.value
puts response.body
end

source

Parse Delicious RSS Feeds

require 'rss'
require 'open-uri'

open('http://del.icio.us/rss/chrisaiv') do |http|
response = http.read
result = RSS::Parser.parse(response, false)
items = result.items

items.each do |item|
puts "Title:" + item.title + "
" + item.link + "
" + item.description + "
"
end

end

source

Generate blogroll from del.icio.us links

<?php
$username   = 'your_username';
$password   = 'your_password';
$cache_file = '/tmp/blogroll.xml';

// check for updates to del.icio.us account
$update = simplexml_load_file("https://{$username}:{$password}@api.del.icio.us/v1/posts/update");

if (strtotime($update['time']) > filemtime($cache_file))
{
// del.icio.us has been updated since last cache; recache
$data = file_get_contents("https://{$username}:{$password}@api.del.icio.us/v1/posts/all?tag=blogroll");
file_put_contents($cache_file, $data);
}

// read links from cached del.icio.us data
$blogroll = simplexml_load_file($cache_file);

foreach ($blogroll->post as $blog)
{
echo '<a href="' . htmlentities($blog['href']) . '">';
echo htmlentities($blog['description']);
echo "</a><br />
";
}
?>

source

del.icio.us History Bookmarklet

javascript:location.href='http://del.icio.us/url/?url='+escape(location.href);

source

del.icio.us Bookmarklet

javascript:window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'delicious','toolbar=no,width=775,height=400');

source

Ruby del.icio.us

require 'rest'
require 'rexml/document'

module Diu
URL = "https://api.del.icio.us/v1/"

class Connection
def initialize(username, password)
@conn = REST::Connection.new(URL, :username => username, :password => password)
@posts = Posts.new(@conn)
end

attr_reader :posts
end

class Posts
class Post
def initialize(xml_item)
@href = xml_item.attributes["href"]
@time = xml_item.attributes["time"]
@hash = xml_item.attributes["hash"]
@tag = xml_item.attributes["tag"]
@description = xml_item.attributes["description"]
@extended = xml_item.attributes["extended"]
end

attr_reader :href, :time, :hash, :tag, :description, :extended
end

def initialize(conn)
@conn = conn
end

def find(method, args = nil)
resource = "posts/%s" % [method]
request = @conn.request_get(resource, args)

posts = Array.new
doc = REXML::Document.new(request)
doc.elements.each("//post") do |xml_post|
posts << Post.new(xml_post)
end
posts
end
end
end

source