Setting Up Facebook Importer to Run via SSH Cron

Home Forums Calendar Products Event Aggregator Setting Up Facebook Importer to Run via SSH Cron

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #956092
    tkwalker
    Participant

    Hi,

    So my website (eventgrabber.com) is essentially an event search engine. We have customized it to run several cron jobs to fetch events across the US. I use your facebook importer as one of them. As you know, your process involves two manual steps in order to avoid timeout errors.

    I wanted to know if it was possible to run your importer script as a cron job on the server. For example, I run the command /usr/local/bin/php to directly run my other apis at a predetermined frequency.

    Is there a better way to do this for the facebook importer? I get a 500 error if I attempt to load over 15 events from the admin panel.

    Thanks in advance for you help
    TK

    #956258
    George
    Participant

    Hey TK,

    Running a cron job like this may indeed be possible, but the level of custom coding required to pull this off is quite a bit outside the scope of the support forum.

    I’d recommend trying to go about creating cron jobs for the Facebook import just as you did for other operations on your site – if specific issues arise from there, then I’d recommend checking out the Facebook documentation (which is quite thorough!) or contacting their support for information about a specific error you run in to.

    It seems to me, with the caveat that I am not an expert on this topic, that if you can get the right information from our Facebook Importer plugin and have enough know-how to do this, that the Facebook API’s “batched request” capabilities might be a good place to start here – https://developers.facebook.com/docs/graph-api/making-multiple-requests

    Just an idea there – sorry for any disappointment on this one TK! Let us know if you have any other questions or concerns, or even a list of freelance developers we recommend to people looking for advanced customizations – one of them may indeed be able to help you write something like this for your site. If you’re interested, email us at [email protected] and we’ll share the list privately there over email.

    Cheers!
    George

    #956773
    James
    Participant

    I’d love to set it up as a direct cron too. for some reason the automatic fetch is not working and I have tested this on multiple wordpress sites I manage. Having the ability to call upon a cron or php to trigger the fetch would be great!

    #957211
    George
    Participant

    Hi James,

    I’m sorry to hear your auto-import isn’t working! Does this behavior change if you change the auto-import intervals at all?

    Also, would you be willing to open a new forum thread so we can address your issues separately? They may be unique to your site(s) – if you do open a thread, on top of the question I asked above can you also list the plugin version numbers for The Events Calendar (core), the Facebook Events add-on, and the version of WordPress itself on your site?

    No worries either way! Whether here or in a different thread, let us know what you think about the above information – hopefully that helps the troubleshooting process along a bit.

    Cheers!
    George

    #957297
    James
    Participant

    Well the auto importer, per my other opened thread Barry is responding, kind of works. Set for hourly it takes the better part of a day at the moment. and we did test on multiple other sites just for kicks and giggles. Same issue.

    So I was hoping there may be some method to call through a direct cron or php file to kick off via a cron or ssh job.

    #957680
    George
    Participant

    Hey James,

    I’m glad to hear you have another thread opened where these specific issues with your import behavior are being addressed.

    As for SSH Cron, this may be possible, but I don’t know how to write it all specifically in its entirety. Some ideas that come to mind that may be possible are to write a manual cron job that just calls the existing auto-import functions within the Facebook Importer plugin itself – there is a WP_Cron action registered named ‘tribe_fb_auto_import’, so firing this action may work well, but there’s also the method that this action calls itself, named do_auto_import() in the main Facebook Importer class…

    I’d recommend studying how the import works, and trying to work backwards from there to figure out how best to automate it in line with your specific needs.

    #957683
    George
    Participant

    Hey TK,

    I just shared some ideas in my above post to James that may be helpful to you too, so definitely check them out:

    As for SSH Cron, this may be possible, but I don’t know how to write it all specifically in its entirety. Some ideas that come to mind that may be possible are to write a manual cron job that just calls the existing auto-import functions within the Facebook Importer plugin itself – there is a WP_Cron action registered named ‘tribe_fb_auto_import’, so firing this action may work well, but there’s also the method that this action calls itself, named do_auto_import() in the main Facebook Importer class…

    I’d recommend studying how the import works, and trying to work backwards from there to figure out how best to automate it in line with your specific needs.

    In regards to this forum thread itself, James mentioned that he has another ticket already open and in progress regarding his specific auto-import issues, and there’s little else we can do here for the customized implementing of SSH cron jobs for your projects’ needs. Do you have any further followup questions here? If not, I’ll go ahead and close up this ticket – though you can always come back and open a new ticket if other questions arise! 🙂

    #984073
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Setting Up Facebook Importer to Run via SSH Cron’ is closed to new replies.