【问题标题】:Yahoo! Pipes and Fullcalendar雅虎!管道和全日历
【发布时间】:2011-05-13 02:04:55
【问题描述】:

我知道 Yahoo!管道可以从 RSS 源创建 JSON 提要。那么是否可以使用 Yahoo! 提供的 JSON 提要?驱动全日历的管道?

Yahoo! 示例管道 JSON 提要: http://pipes.yahoo.com/pipes/pipe.run?_id=b551e36fb568c5b2bc4bb088af7bd737&_render=json

我从来没有使用过 JSON,所以我不知道接下来应该如何处理这个文件。 -- 我是否下载它,我是否将它指向完整日历代码中某处的这个 url,我是否用 PHP 重新格式化它?带有后续步骤示例的响应会很可爱。

我认为这个问题的答案对于希望使用 RSS 提要来驱动他们的日历的人们会非常有帮助!

【问题讨论】:

    标签: json fullcalendar yahoo-pipes


    【解决方案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 提要,因此它知道使用来自 fullcander 的函数方法提取或排序哪些信息并将项目推送到数组。

    Json 应该是这样的

    首先你需要删除第一部分' {"count":18,"value" ' - 这个信息可能很好,但不适用于 FC

    然后它以 ':{"title' 开头,但这应该是第一个字符,应该看起来更像

    [{"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/

    这是一个工作演示,该想法有效。你只需要让它处理 Yahoo!饲料。

    http://jsfiddle.net/ppumkin/6wE8v/

    你想专注于这部分

    var event = [];
                event.push({
                    title: 'Garten',
                    start: '2011-05-10T00:00:00',
                    allday: true
    

    查看这篇 SO Post,您可以看到用户如何使用 SQL 推送对象 - 您需要对返回的 json 提要执行类似的操作

    No Callback after SQLite-Request

    这些都是很好的例子。您现在知道如何限制搜索以获取更多信息。

    【讨论】:

    • 这是经过深思熟虑的,非常有帮助!! ——我非常感谢它,现在会更多地研究它! :)
    • 如果您觉得它有帮助,请决定投票或接受我的回答。如果您需要更多帮助,我不会介意。但是投票的积分是我的动力......:D
    猜你喜欢
    • 1970-01-01
    • 2013-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-26
    • 2015-05-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多