Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Customized Json Feeds

edited January 2012 in Vanilla 2.0 - 2.8

Hi all,

I need to create some customized Json feeds relative to a single user activity as for example the number of posts by this user. As I am totally new to Vanilla I am reading the documentation but I feel a bit lost as I don't know what I really need to create: plugin, controller, other? I saw in the documentation that some Json feeds are already available. How can I create my own feeds?

Thanks in advance,
Julio

Tagged:

Answers

  • There is already an api.

    get https://addons.mozilla.org/en-US/firefox/addon/jsonview/ for convenience

    You can view your user meta here:
    http://vanillaforums.org/profile.json/35671/julio2012

    grep is your friend.

  • Thanks. That solves many problems. Anyway is possible creating customized json feeds?

  • Yeah, you could do that as a plugin pretty easy. Set info in the Data variable and it should come out in any page ending in .json.

  • For "Data" you mean I should extend "Gdn_Controller" and using the "JsonTarget" function in it?

  • Mate we said it is possible, there some documentation on how to create plugins, and you can look at the code, but you are not going to get programming lessons. If you don't feel up to I would pay someone to do it.

    Vanilla/Garden follows MCV, it is roughly restful. So a controller could server anything like xml, json.

    I don't know what you mean by "feed", if you are talking about a specific standard or schema you have to implement that. I could be templates, like rss feeds are.

    grep is your friend.

  • What Lincoln is talking about when you hook a controller before it is rendered you can

    $Sender->SetData('SomeData',$SomeData);
    

    This is generally the case existent controllers. However one persons definition of easy isn't another.

    if you are talking about creating new methods, or entire controllers, and json resources, that is a bit more work.

    grep is your friend.

Sign In or Register to comment.