We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38723
    • 165 Posts
    So far I've managed to get Twitter, Zootool, YouTube working but am having problems with Flickr json feeds - I don't seem to be able to get the snippet to output anything, but the dataSetUrl is definitely correct, and I can load this separately in the browser.

    The working snippet calls look like this:

    Zootool
      <ul>
       
    [[!simplx_widgeteer? 
      &dataSetUrl=`http://zootool.com/api/users/items/?username=pdincubus&apikey=REMOVED&limit=10`
      &useChunkMatching=`true`
      &preprocessor=`widgeteer_preprocessor_zootool`
      &chunkPrefix=`widgeteer_template_zootool_`
    ]]
      </ul>


    Twitter
      <ul>
    [[!simplx_widgeteer? 
      &dataSetUrl=`http://api.twitter.com/1/statuses/user_timeline.json?screen_name=pdincubus&count=3&include_rts=true`
      &useChunkMatching=`true`
      &preprocessor=`widgeteer_preprocessor_twitter`
      &chunkPrefix=`widgeteer_template_twitter_`
    ]]
      </ul>


    YouTube
      <ul>
       [[simplx_widgeteer?
      &dataSetUrl=`http://gdata.youtube.com/feeds/api/users/pdincubus/favorites?v=2&alt=json&max-results=5`	
    
            &dataSetRoot=`feed`
    &useChunkMatching=`true`
    &chunkMatchRoot=`false`
            &chunkPrefix=`widgeteer_template_yt_`
          ]]
      </ul>


    I've tried combinations from the above to make the Flickr feed work, this is what it's currently set to:

    <ul>
         [[simplx_widgeteer?
            &dataSetUrl=`http://api.flickr.com/services/feeds/photos_public.gne?id=22342246@N03&lang=en-us&format=json`
    	&useChunkMatching=`false`
            &staticChunkName=`widgeteer_template_flickr_items`
          ]]
      </ul>


    The Flickr feed begins like this:

    jsonFlickrFeed({
    		"title": "Uploads from pdincubus",
    		"link": "http://www.flickr.com/photos/pdincubus/",
    		"description": "",
    		"modified": "2012-02-14T15:17:02Z",
    		"generator": "http://www.flickr.com/",
    		"items": [
    	            { ...... }
                     ]
                  })
    


    So I don't think I need to use a preprocessor here. I've tried with and without the &dataSetRoot set to either jsonFlickrFeed or items, or indeed jsonFlickrFeed.items to see if I can target any of those parts of the json feed.

    The static chunk for this is:

    <li>
      <a href="[[+link]]">
        <img src="[[+media.m]]" alt="[[+title]]">
        [[+title]]
      </a>
    </li>
    


    I've also tried chunk matching too but I figure I'm doing something very simple wrong as all the other feeds worked in a relatively straight forward manner.

    Anything obvious I've done wrong here? Any help much appreciated.
      • 8883
      • 59 Posts
      Dead thread maybe - but beacuse i was trying to fetch a json from flickr (photoset) too, I had the same problem like you. Just blank output, but i found a solution.


      Because flickr-api is served by HTTPS/SSL the quick-solution for simplx-widgeteer 0.8.5 is to set CURLOPT_SSL_VERIFYPEER to false.

      In Snippet-Code around line 93 within the function
      loadDataSource($dSourceURL) {...}

      add
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false); //line 104



        • 3749
        • 24,544 Posts
        Good tip. Thanks! smiley
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 46580
          • 167 Posts
          Doesn't work for me :/

          Quote from: endyzer at Oct 11, 2014, 12:59 AM
          Dead thread maybe - but beacuse i was trying to fetch a json from flickr (photoset) too, I had the same problem like you. Just blank output, but i found a solution.


          Because flickr-api is served by HTTPS/SSL the quick-solution for simplx-widgeteer 0.8.5 is to set CURLOPT_SSL_VERIFYPEER to false.

          In Snippet-Code around line 93 within the function
          loadDataSource($dSourceURL) {...}

          add
          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false); //line 104



            MODX lover
            -
            Développeur MODX / Webdesign / Solutions web