代码之家  ›  专栏  ›  技术社区  ›  Matt Fichman

如何仅从Google Sites API内容提要下载元数据?

  •  0
  • Matt Fichman  · 技术社区  · 14 年前

    我想下载我的谷歌网站中页面的URL列表。我正在使用Python API来实现这一点。它似乎比我预期的要慢,所以我认为它实际上是为每个条目下载整个内容,而不仅仅是元数据。有没有办法只下载元数据?我的代码如下:

    import gdata.sites.client
    
    client = gdata.sites.client.SitesClient(site='mysite', domain='mydomain.com')
    client.ClientLogin('foo@bar.com', 'password', 'test')
    feed = client.GetContentFeed()
    for entry in feed.entry:
        print entry.GetAlternateLink().href
    
    1 回复  |  直到 14 年前
        1
  •  1
  •   bossylobster    14 年前

    最接近的近似值是

    https://sites.google.com/site/(your site name)/system/feeds/sitemap
    

    不幸的是,此API不允许使用 fields 就像一些新的谷歌API一样。