HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Version Checker for Plugins. R ur plugins up to date and the most recent. This will tell you.

peregrineperegrine MVP
edited March 2013 in Feedback

Don't know if any one wants to try this out - and see if it works for you.

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

«1

Comments

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited March 2013

    Really like the idea and it works a treat! However, instead of using Simple HTML Dom to get the latest version, have you considered using RSS? E.g: http://vanillaforums.org/addon/memberslistenh-plugin.rss. Should be much easier and much more efficient

    P.S.: The RSS feed contains some pretty useful stuff

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff

    There it was! Couldn't find the right URL for the JSON and XML feeds :)

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • general format is

    controller.json/somemethod/args

    Alternatively

    http://vanillaforums.org/addon/1077/version-check?DeliveryMethod=JSON&DeliveryType=DATA

    grep is your friend.

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff

    I actually thought it was controller/method.[json/xml]/args - thanks for pointing it out!

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    Yeah, peregrine is running hot, great thanx. :)

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • peregrineperegrine MVP
    edited March 2013

    thx for the tips - guys. I'll look in to changing it. Glad you like the idea.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited March 2013

    As an example - would I be retrieving this in a file_get and parsing or is there a better idea.

    http://vanillaforums.org/addon/versioncheck-plugin.xml?DeliveryMethod=JSON&DeliveryType=DATA

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • businessdadbusinessdad Stealth contributor MVP

    @peregrine said:
    As an example - would I be retrieving this in a file_get and parsing or is there a better idea.

    http://vanillaforums.org/addon/versioncheck-plugin.xml?DeliveryMethod=JSON&DeliveryType=DATA

    There are several ways to get the data:

    • file_get_contents(), which you already mentioned.
    • cURL, also quite common, but it might be overkill.
    • fsockopen() and fread().

    I would do something like this, more or less:

    • Loop through the installed plugins.
    • For each, get the JSON from vanilla.org, using one of the methods listed above.
    • Using json_decode(), transform the JSON into a PHP object.
    • Read object's properties, and you're ready to go.
  • thx. businessdad - By the time I read your message. I had already rewritten the program. just like you said. Maybe you were channeling thoughts. Now - what does that mean??? :).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • x00x00 MVP
    edited March 2013

    use ProxyRequest, it is the native function for exactly this, and simplifies the connection and retrieval.

    It is curl based, by the other methods are not requirements, curl is a requirement usually, so it is consistent.

    for some reason vanillaforums.org does not allow for JSONP where as vanilla 2.0 and 2.1 automatically pick up the callback and turn he JSON into JSONP.

    Otherwise you could connect directly with jQuery.

    You could still do it on the client side, by proxying it through a local location and using ProxyRequest, then just sending the valid JSON back.

    grep is your friend.

  • peregrineperegrine MVP
    edited March 2013

    .

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited March 2013

    @x00 I used this
    version 1.1 based on kasper's idea for speed and your further ideas up until the proxyrequest change.

    $getlink = 'http://vanillaforums.org/addon/versioncheck-plugin.xml?DeliveryMethod=JSON&DeliveryType=DATA';

    I'll have to study up on proxyrequest or if you can take a look at the program and pass on some pointers.

    It is extremely fast using the file get
    file_get_contents($getlink);

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • file_get_contents external urls are often blocked on some hosts, especially php safemode.

    grep is your friend.

  • peregrineperegrine MVP
    edited March 2013

    @x00 said:

    file_get_contents external urls are often blocked on some hosts, especially php safemode.

    I grok you.

    sooner or later I'll try another update if anyone has some issues with file_get_contents . meanwhile this will probably work for most.

    You don't need the .xml bit

    thx.

    it works with .xml, but I will update if I do the proxryequest thing.

    thanks for all the great ideas everyone.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • $Data = ProxyRequest($Url);

    this function checks for curl, if not there it uses fsockopen, which has marginally more support than file_get_contents

    grep is your friend.

  • what I meant is it is json not xml, the xml bit isn't relevant.

    grep is your friend.

  • also these other functions have timeouts it is important to have sensible timeouts. The default is a second.

    grep is your friend.

  • businessdadbusinessdad Stealth contributor MVP

    @x00 said:
    $Data = ProxyRequest($Url);

    this function checks for curl, if not there it uses fsockopen, which has marginally more support than file_get_contents

    That's good to know. The only thing I found odd is that cURL seems to be significantly slower than fsockopen(). I used them both when I developed my Advanced Logger, and I had to replace cURL because it was sluggish (it was for POSTing data, though, not for retrieving it).

Sign In or Register to comment.