當前位置: 首頁>>代碼示例>>Python>>正文


Python Feed.url方法代碼示例

本文整理匯總了Python中feed.Feed.url方法的典型用法代碼示例。如果您正苦於以下問題:Python Feed.url方法的具體用法?Python Feed.url怎麽用?Python Feed.url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在feed.Feed的用法示例。


在下文中一共展示了Feed.url方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testEqual

# 需要導入模塊: from feed import Feed [as 別名]
# 或者: from feed.Feed import url [as 別名]
 def testEqual(self):
     feed = Feed()
     feed.title = self.feed.title
     feed.updated = self.feed.updated
     feed.entries = self.feed.entries
     feed.url = self.feed.url
     feed.homepage = self.feed.homepage
     feed.author = self.feed.author
     self.assertEqual(self.feed, feed)
開發者ID:apaku,項目名稱:slimfeed,代碼行數:11,代碼來源:test_feed.py

示例2: htmlSource

# 需要導入模塊: from feed import Feed [as 別名]
# 或者: from feed.Feed import url [as 別名]
def htmlSource(request):
  sites = ['FourChan', 'Fukung', 'Senorgif', 'Knowyourmeme' ]
  random.shuffle(sites)
  images = [] 
  images = globals()[sites[0]]().do().images()
  while not images:
   random.shuffle(sites)
   images = globals()[sites[0]]().do().images() 
  random.shuffle(images)
  if not Feed.gql("WHERE url = :1", images[0]).fetch(1):
    feed = Feed()
    feed.url = images[0]
    feed.put()
  return render_to_response('boardTemplate.html', {'image' : images[0]})
開發者ID:cairesvs,項目名稱:randmzr,代碼行數:16,代碼來源:views.py

示例3: createFeedFromData

# 需要導入模塊: from feed import Feed [as 別名]
# 或者: from feed.Feed import url [as 別名]
def createFeedFromData(data, entryclz=Entry):
    if data["bozo"] == 1:
        return None
    feed = Feed()
    if "title" in data["feed"]:
        feed.title = data["feed"]["title"]
    else:
        feed.title = "No Title provided"

    if "links" in data["feed"]:
        for link in data["feed"]["links"]:
            if "rel" in link and link["rel"] == "self":
                feed.url = link["href"]
    if "link" in data["feed"]:
        feed.homepage = data["feed"]["link"]
    if "author" in data["feed"]:
        feed.author = data["feed"]["author"]
    else:
        feed.author = "No Author provided"
    if "updated_parsed" in data["feed"]:
        feed.updated = data["feed"]["updated_parsed"]
    for edata in data["entries"]:
        feed.entries.append(createEntryFromData(data=edata, entryclz=entryclz))
    return feed
開發者ID:apaku,項目名稱:slimfeed,代碼行數:26,代碼來源:feedparserfactory.py


注:本文中的feed.Feed.url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。