• Resolved Joris

    (@jvanhurne)


    Hi Franky,

    to make importing easier, I use a facebook profile, that I use to join all the events from my city.

    You can probably imagine that i have quite a lot of public events. When I import them to EME however, the importing stops after the first 25 events it finds. I guess it has something to do with “paging” of the graph API, that uses a limit of 25 automatically.

    Is there a way I can change this limit? or get all the events for my page in any other way.

    I hope you can help me.

    best regards,

    Joris

    https://www.ads-software.com/plugins/eme-sync-facebook-events/

Viewing 10 replies - 31 through 40 (of 40 total)
  • Thread Starter Joris

    (@jvanhurne)

    I definitely realize that I am pushing limits with the amount of events, although I already found several topics about optimizing graph API queries. I’ll post some link later, but i’m sure you’ll know 100% better and faster what is useful.

    Or maybe something in the WordPress settings that could help?
    I’ve read something as well about the “limit” of API Calls (600/600seconds)?

    —–
    PS. Unrelated question: (I could start a new topic for it if you’d like)
    Can Events be somehow linked to the standard WordPress Categories? (so my theme can recognise these categories for front page display?
    —–
    Thanks again for the awesome work!

    Plugin Author Franky

    (@liedekef)

    I haven’t read about the API limit of calls/sec, but you might be right.
    Concerning the categories: nope, since events are not posts they are somewhat “detached” from the standard wordpress categories and such.
    I’m interested to hear about optimizing the API queries (remember: not FQL, but graph queries)

    Thread Starter Joris

    (@jvanhurne)

    Hey Franky, i was looking in to ways to combat the script time-out. Almost every source referred to adding a line of code the PHP.ini to set the time-out timer. Being on shared hosting, of course I don’t have access to PHP.ini

    So I was glad to find another solution for this. And actually it could not be any simpler:

    I added the following to the top of eme-sync-facebook-events.php

    // set the PHP timelimit to 10 minutes
    set_time_limit(900);

    which sets the runtime of the import script to 15 minutes.

    This got me a return of around 200-225 synced&skipped events/locations in 3 different test runs, but of course it would be to easy if everything would be solved this way. After syncing around 200 events/locations the same mid-sentence stop occurs….and since this happened after about 4-5 minutes it shouldn’t be the script timing-out, that is causing the sync to stop.

    Thread Starter Joris

    (@jvanhurne)

    Some references I found. I hope they are in any way useful for you.

    https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0

    https://developers.facebook.com/docs/marketing-api/api-rate-limiting

    Making Large Requests
    Some Graph API endpoints can take parameters that are very large. If your requests end up being larger than a couple thousand characters, you may start seeing server errors since our servers will reject very large GET requests.

    As a best practice, for large requests use a POST request instead of a GET request and add a method=GET parameter. If you do this, the POST will be interpreted as if it were a GET.

    Thread Starter Joris

    (@jvanhurne)

    ideally, importing all the data from the query below, would be possible. Basically, this one query contains all the data I need. (but I’m guessing, there is a bit more to it than that)

    https://graph.facebook.com/v2.3/me?fields=id,name,events{id,name,cover,owner,place,start_time,end_time,description,ticket_uri,attending_count,attending,picture{url,height,width}}

    (me= 120011001664839)

    Thread Starter Joris

    (@jvanhurne)

    Update: got syncing up to 250 events & locations

    Plugin Author Franky

    (@liedekef)

    Ok, your query sounds promising …
    Try this:
    https://plugins.trac.www.ads-software.com/changeset/1186475

    Thread Starter Joris

    (@jvanhurne)

    [Large code excerpt removed by moderator per forum rules. Please use the pastebin for all large code excerpts. It works better anyway.]

    Plugin Author Franky

    (@liedekef)

    I think Joris wanted to show the world a huge list of skipped/synced events ??
    For reference: it works now (Joris confirmed in private), just the php execution timeout needs to be big enough (at least bigger than the default of 30 seconds)
    So: I’ll consider this resolved and release a new version asap.

    Thread Starter Joris

    (@jvanhurne)

    in my front-end in never even showed this long list.

    But I can definitely confirm that this issue has been resolved!

Viewing 10 replies - 31 through 40 (of 40 total)
  • The topic ‘Not Importing all events of my page’ is closed to new replies.