我知道Yahoo!管道可以从RSS源创建JSON源。是否有可能使用Yahoo!提供的JSON提要。管道驱动fullcalendar?
Yahoo!的示例管道JSON提要: http://pipes.yahoo.com/pipes/pipe.run?_id=b551e36fb568c5b2bc4bb088af7bd737&_render=json
我从来没有使用过JSON,所以我不知道接下来要用这个文件做什么。 - 我是否下载它,是否将它指向fullcalendar代码中的某个URL,我是否用PHP重新格式化?以下一步为例的回答很可爱。
我认为这个问题的答案对于希望使用RSS源来驱动日历的人来说非常有用!
答案 0 :(得分:1)
我不会被要求让你成为一个例子..但我可以告诉你应该分解
雅虎!订阅
{"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 Calendar XML Feed,因此它知道要使用fromcancan中的函数方法提取或排序的信息,并将项目推送到数组。
Json应该是这样的
首先你需要删除第一部分'{“count”:18,“value”' - 这个信息可能不错但不适用于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推送目标 - 您将需要使用与您返回的json Feed类似的操作
No Callback after SQLite-Request
这些都是很好的例子..您现在知道如何限制搜索以获取更多信息。