我知道Yahoo!Pipes可以从RSS源创建JSON提要。那么是否可以使用Yahoo!Pipes提供的JSON提要来驱动全日历?
Yahoo! Pipes JSON feed的示例:http://pipes.yahoo.com/pipes/pipe.run?_id=b551e36fb568c5b2bc4bb088af7bd737&_render=json
我从未使用过 JSON,所以我不知道接下来应该如何处理这个文件。 -- 我是否下载它,是否将其指向完整日历代码中的某个位置的此 url,是否用 PHP 重新格式化?带有后续步骤示例的响应会很可爱。
我认为这个问题的答案对于希望使用 RSS 提要来驱动日历的人来说非常有帮助!
我不会被要求给你举个例子......但我可以告诉你细分应该是什么
雅虎提要
{"count":18,"value":{"title":"Academy Theatre","description":"Upcoming Events","link":"http://pipes.yahoo.com/pipes/pipe.info?_id=b551e36fb568c5b2bc4bb088af7bd737","pubDate":"Thu, 12 May 2011 22:09:18 -0700","generator":"http://pipes.yahoo.com/pipes/","callback":"","items":[{"link":"http://www.brownpapertickets.com/event/130787","y:title":"Platinum Championship Wrestling","y:id":{"value":null,"permalink":"true"},"title":"Platinum Championship Wrestling","pubDate":"2011-05-13 20:00:00","description":"The PCW Championship Fridays at 8 P.M. - With the coming of 'Sacred Ground II', will Jay Fury finally wrest the PCW crown? How will the new Tag Team Season progress? Will The Assasins Guild finally make it to the top of the heap? Will The Koncrete Gorillas take over? You have to be there every Friday Night to know for sure!","y:published":{"hour":"3","timezone":"UTC","second":"0","month":"5","minute":"0","utime":"1305342000","day":"14","day_of_week":"6","year":"2011"}},{"link":"http://www.brownpapertickets.com/event/173914","y:title":""Ahoy, Pirates and Mermaids"","y:id":{"value":null,"permalink":"true"},"title":""Ahoy, Pirates and Mermaids"","pubDate":"2011-05-16 09:00:00","description":"Summer Drama Camp (4-7yrs) - June 6-11 from 9:30am-12:30 pm (for early drop off and late pick up options- contact Avondale Playhouse directly). An adventure on the high seas!! We will be exploring age appropriate stories with this theme and dramatizing them with the h
里面有分配的信息。这将需要一个插件...像 gcal.js 处理 Google 日历 XML 提要,以便它知道要使用函数方法从 fullcander 中提取或排序哪些信息,并将项目推送到数组。
Json 应该看起来像这样
首先,您需要删除第一部分" {"计数":18,"值" ' - 此信息可能很好,但不适用于 FC
然后它以":{"标题"开头,但这应该是第一个字符,应该看起来更像
[{"title":"Acadmeny Theatre","description":"Upcoming Events"
然后是url,y.title,y.url之类的东西,你需要的是"pubDate",它只需要是日期。 然后它似乎继续做更多的东西
因此,理想情况下,您提供回 FC 的 json 应如下所示
[{"title":"Acadmeny Theatre","description":"Upcoming Events","Date":"Thu, 12 May 2011 22:09:18 -0700"},{"title":"next Title","description":"MOre InfoEvents","Date":"Thu, 14 May 2011 22:09:18 -0700"}]
FC将在12日和14日将其作为2个事件
FC 文档对此进行了很好的解释。
以下是有关如何使用 FC 函数从您需要的源构建数组的文档
http://arshaw.com/fullcalendar/docs/event_data/events_function/
这是一个工作演示,摆弄这个想法。你只需要让它处理雅虎提要。
http://jsfiddle.net/ppumkin/6wE8v/
你想专注于这部分
var event = [];
event.push({
title: 'Garten',
start: '2011-05-10T00:00:00',
allday: true
查看此SO帖子,您可以看到用户如何使用SQL来推送objec-您需要对返回的json提要执行类似操作
SQLite-Request 后没有回调
这些都是很好的例子......你现在知道如何限制你的搜索以获取更多信息。