使用 Excel 2010 和参数的可刷新 Web 查询

发布于 2024-11-29 08:19:24 字数 997 浏览 0 评论 0原文

我希望从 Feedburner 的 API 中提取 XML 提要。这只需编写 URL 并在 Excel 中使用“来自 Web”数据连接即可。

https://feedburner.google.com/api/awareness/1.0/GetItemData?uri=RSSFEEDNAME&dates=2011-08-01,2011-08-05

这工作正常(并且相当快)。

现在,我希望能够更新“日期”表中的两个单元格,以使其提取该范围的数据。这是使用网址中的参数完成的:

https://feedburner。 google.com/api/awareness/1.0/GetItemData?uri=RSSFEEDNAME[]

使用 Excel UI,我可以将 [] 分配给任何单元格。但是,无论我如何尝试,这都行不通。我最初认为日期格式可能存在一些问题,所以我自己努力进入单元格,准确的副本 (&dates=2011-08-01,2011-08-05) 为文本。

每次,提要都会仅提取当前日期的数据(这是未指定日期时的默认行为)。它没有给出错误(对于相对较小的违规行为,例如没有两位数的月份,它会这样做),这让我认为它只是没有用指定的文本替换 [] 。我还对 WebTrends Web 服务查询使用相同的方法,并得到类似的令人沮丧的结果。我已经阅读了有关网络查询的所有操作方法,并且完全遵循它们。

我找不到任何地方可以查看 Excel 所请求的最终 URL,因此这有点盲目。对于后续步骤的任何想法将不胜感激!

最好的, 内森

I'm looking to pull into the XML feed from Feedburner's API. This is just a matter of writing the URL and using the "From Web" data connection in Excel.

https://feedburner.google.com/api/awareness/1.0/GetItemData?uri=RSSFEEDNAME&dates=2011-08-01,2011-08-05

This works fine (and is pretty fast).

Now, I'd like to be able to update two cells in the "dates" sheet to have it pull that range of data. This is done using parameters in the URL:

https://feedburner.google.com/api/awareness/1.0/GetItemData?uri=RSSFEEDNAME[]

Using the Excel UI, I can then assign the [] to any cell. However, no matter what I try, this doesn't work. I initially thought there might be some issue with the date format so I've worked myself to the point where I am entering into the cell, the exact copy (&dates=2011-08-01,2011-08-05) as text.

Each time, the feed pulls up with just the current days data (which is the default behavior when no dates are specified). It isn't giving an error (which it will do for relatively small infractions, like not having two-digit months) which makes me think it just simply isn't replacing the [] with the specified text. I'm also using this same method for a WebTrends Web Service query and gettign similarly frustrating results. I've read every how-to on web queries, and I'm following them exactly.

I can't find any place to see what the final URL Excel is requesting, so it's a bit of a shot in the dark. Any thoughts on next steps would be greatly appreciated!

Best,
Nathan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心房的律动 2024-12-06 08:19:24

答案是否定的,不使用 Web 查询“向导”,而是手动完成。

  1. 打开记事本(或某些文本编辑器)
  2. 在编辑器中键入以下四行:

    <前><代码>WEB
    1
    http://example.com/index.html?something=[]&somethingelse=[]
    [空白的]

  3. 将其另存为带有 .iqy 扩展名的任何内容。
  4. 打开 Excel,转到“数据”功能区,然后单击“现有连接”
  5. 单击“浏览更多...”
  6. 找到您制作的 IQY 文件并单击“打开”

Excel 然后会询问您要将结果数据放在哪里,然后根据您在 URL 中输入的每个占位符的提示。这些提示允许您输入值,或选择一个单元格作为数据。

The answer was no to use the Web Query "wizard" and just do it by hand.

  1. Open Notepad (or some text editor)
  2. In the editor type the following four lines:

    WEB
    1
    http://example.com/index.html?something=[]&somethingelse=[]
    [BLANK]
    
  3. Save it as anything with an .iqy extension.
  4. Open Excel, go to the Data ribbon, and click "Existing Connections"
  5. Click "Browse for More..."
  6. Find the IQY file you made and click "Open"

Excel will then ask you where you want to put the resulting data, followed by prompts for each placeholder you entered in the URL. Those prompts let you either type in a value, or select a cell to act as the data.

羞稚 2024-12-06 08:19:24

我本以为 dates 应该是一个命名参数,并且您应该将其链接到具有日期值的单元格。

只要您创建命名参数 dates 并将其链接到该单元格,该单元格的值就应该是 2011-08-01,2011-08-05

I would have thought that dates should have been a named parameter and that you should link that to whichever cell has the date value(s).

The cell should just have 2011-08-01,2011-08-05 as its value as long as you create the named parameter dates and link it to that cell

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文