1

Google Feed API を使用してフィードを読み込もうとしていますが、最新のレコードを取得できません。私は以下を試しました:

<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
  <script type="text/javascript">
      $(function () {
          url = 'http://www.propertyguru.com.sg/news-rss/SG-PM';
          var randomNum = Math.floor((Math.random() * 10000) + 1);
          $.ajax({
              type: "GET",
              url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=20&callback=?&q=' + encodeURIComponent(url) + '&nocache=' + (new Date).getTime() + randomNum,
              dataType: 'json',
              historical: false,
              error: function () {
                  alert("Unable to load feed, Incorrect path or invalid feed");
              },
              success: function (data) {
                  alert(JSON.stringify(data, null, "\t"));
              }
          });
      });
  </script>
4

1 に答える 1