• Resolved Anonymous User 16700017

    (@anonymized-16700017)


    First of all, I love your plugin! I’m currently using it on a couple of websites.

    Now I’m trying to display results based on gender. The gender designation in the json I want to display consists of one letter. I can’t figure out how to display just females or just males in the results. How do I do that?

    The json I’m using is:
    https://chaturbate.com/affiliates/api/onlinerooms/?format=json&wm=MUIXl

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author berkux

    (@berkux)

    the free version can check each entry on a special string (e. g. “f”) with oneofthesewordsmustbein. If this is in the output-item-string then show it, otherwise not.
    As here “f” or “m” might occur in other data this won’t match as you like. So you have to define a outoutfield “Gender f” and check on that.
    If you need a really reliabl way on checking the gender field directly you need the pro plugin.

    Bernhard

    Thread Starter Anonymous User 16700017

    (@anonymized-16700017)

    How do I define an outputfield?

    Plugin Author berkux

    (@berkux)

    this should look like

    [jsoncontentimporter url=https://de.chaturbate.com/affiliates/api/onlinerooms/?wm=MUIXl&format=json oneofthesewordsmustbein="gender f" oneofthesewordsmustbeindepth=2 urlgettimeout=120 DEdebugmode=10]
    num_followers: {num_followers}, gender {gender}<br>
    [/jsoncontentimporter]

    This loops (if the API is not too slow as now) through all items.
    Sometimes its “gender m”, sometimes “gender f”. This is checked by oneofthesewordsmustbein.

    • This reply was modified 7 years, 5 months ago by berkux.
    • This reply was modified 7 years, 5 months ago by berkux.
    Thread Starter Anonymous User 16700017

    (@anonymized-16700017)

    Beautiful! Works like a charm! Thank you!

    One more question. Using numberofdisplayeditems does’t work correctly now. If I add:

    numberofdisplayeditems=5 oneofthesewordsmustbein=”gender m” oneofthesewordsmustbeindepth=2

    and only 2 out of the 1st 5 records are “gender m” then that’s all I get. It stops looping at 5, not at 5 results. Is there another way I can limit results printed?

    • This reply was modified 7 years, 5 months ago by Anonymous User 16700017.
    Thread Starter Anonymous User 16700017

    (@anonymized-16700017)

    Or alternatively is there a way to paginate results?

    Plugin Author berkux

    (@berkux)

    this is a limitation of the free plugin, the prp plugin can paginate and has a besser way to select needed items:
    api.json-content-importer.com/pagination-by-twig/?no=2

    i am also trying to use this please help me how i can display following data using this plugin

    https://www.simplilearn.com/api/v1/index?method=getCoursesData&identifier=CorePMEssentials&pageNum=1

    Plugin Author berkux

    (@berkux)

    Pleaes help me how i can use where condition, eg if i want to record for specific id course_id=1234

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘How do I display results based on json object’ is closed to new replies.