国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
真正的Web2.0:書簽?標記?_Web服務(wù)技巧_Web2.0_TechTarget IT...
本土方法

  您可能只是對門面仰慕已久,而在 Web 2.0 站點的某些點上,您會尋求某些工具,用甚至站點創(chuàng)建者都沒有預(yù)見到的方法獲得站點功能。對于 del.icio.us 來說,有很多這樣的工具。開始時,站點的創(chuàng)建者提供他們自己的一些工具,從可用于在其他站點上顯示您網(wǎng)絡(luò)中的帖子的標記到瀏覽器工具欄。此外,一百多個第三方工具覆蓋了您能想像到的 del.icio.us 的大多數(shù)用途,大多數(shù),但并非全部,所以可以這樣歸納,Web 2.0 站點的重要性就在于您可以突破編譯器或解釋程序,創(chuàng)建您自己的特性。

  Web 提要:便宜的 API

  del.icio.us 的官方 API 使用 HTTP 以及 SSL 和身份驗證。但是如果您只需要讀訪問,那么可以選擇整體上采用 Web 2.0 的更為官方的 API:Web 提要。您可以訪問用戶(http://del.icio.us/rss/<username>)、標記(http://del.icio.us/rss/<tag>)或者兩者組合(http://del.icio.us/rss/<username>/<tag>)的 Web 提要。那么問題只在于解析 Web 提要以提取所需信息。清單 1 提供了一個示例。它是 Python 代碼,該代碼發(fā)送包含前一天 del.icio.us 提要條目的電子郵件。

  清單 1. 用于發(fā)送前一天 del.icio.us 帖子的電子郵件的代碼

import time
import smtplib
from email.MIMEText import MIMEText
from datetime import date, timedelta

import amara

#The base URI for all tags
TAGBASE = ‘http://del.icio.us/tag/‘

#Set FEEDS to customize which feeds you want to monitor
FEEDS = [‘http://del.icio.us/rss/uche‘, ‘http://del.icio.us/rss/popular‘]

FROM = ‘del.icio.us@example.com‘
TO = ‘user@example.com‘
SMTPHOST = ‘localhost‘

#Compute the date string for yesterday in ISO-8601 format
yesterday = (date(*time.gmtime()[:3]) - timedelta(1)).isoformat()

message_text = u‘‘

#Using Amara. Easy to just grab the RSS feed
for feed in FEEDS:
    doc = amara.parse(feed)
    message_text += u‘\n‘ + unicode(doc.RDF.channel.title) + u‘\n\n‘
    current_items = [ item for item in doc.RDF.item
                      if unicode(item.date).startswith(yesterday) ]
    for item in current_items:
        #Get the properties of the link, defaulting to empty string
        title = unicode(getattr(item, ‘title‘, u‘‘))
        href = unicode(getattr(item, ‘link‘, u‘‘))
        desc = unicode(getattr(item, ‘description‘, u‘‘))
        creator = unicode(getattr(item, ‘creator‘, u‘‘))
        message_text += u‘<%s>--"%s" (from %s)\n‘%(href, title, creator)
        message_text += desc + ‘\n‘

#Be sure to handle Unicode by encoding to UTF-8
msg = MIMEText(message_text.encode(‘utf-8‘))

#Set message metadata
msg[‘Subject‘] = u‘del.icio.us bookmarks for %s\n‘ % yesterday
msg[‘From‘] = FROM
msg[‘To‘] = TO

#Send the message via the specified SMTP server
s = smtplib.SMTP()
s.connect(SMTPHOST)
#s.login(SMTP_USERNAME, SMTP_PASSWORD) #If login is necessary
s.sendmail(FROM, [TO], msg.as_string())
s.close()

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
km360 Web 2.0公司大獲成功的10個步驟
diggdot.us=Digg slashdot del.icio.us | web2.0
Web 2.0與網(wǎng)頁設(shè)計
什么是Web3.0?答案——當(dāng)web網(wǎng)站成為web服務(wù)
2.0.0.5
del.icio.us網(wǎng)摘發(fā)送功能
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服