Sync data on per user basis - php

I have an application which connect two different APIs & built on the Codeignitor3 PHP framework. Below is the flow.
User register with us.
Users add API key for both the API's platform.
We sync products & order from one API to other API.
Now the questions are:
I need this to be automated, for that I have added a CRON JOB to achieve this & for 1 - 10 users it is working fine.
I want to know the best approach to sync data automatically when My application has more than 500 users. Please note that I need to sync data once a hour per each user.
There are no Webhooks provided so I need to work with API's only.
I am not able to find a suitable and best approach for this So I am posting here.
Kindly suggest

You must give a try of AWS Lambda Service.

Related

How to build a basic web app on WordPress site using AWS API Gateway

I want to build a simple Software-as-a-service web application that performs web scraping - the result per execution will be a table of results with several rows and columns. For the front-end, I wanted to build the website using WordPress since I am familiar with making basic websites there and like the plugins available. For the backend I plan on using AWS Lambda to perform the task serverless-ly. The user will log in to the site, then when they want to use the service will enter some keywords via a form, and that will send HTTP request to AWS API Gateway, which is connected to my Lambda function. Currently, the AWS Lambda function writes results into AWS DynamoDB as it goes - perhaps I need to write a second HTTP request method to query the results, or return the results in the same method that scrapes them instead.
Even after hours of googling, there are several areas in which I am unsure how to proceed, or if I have chosen the right path (I have no prior experience in this area.) Two of the biggest puzzles I have currently though are:
How can I use WordPress to send data to AWS API Gateway? Do I need to write some PHP code and if so what does it look like and where should I put it?
How can I present the results on WordPress site for the user? Should I keep the results saved on DynamoDB and query them when I want to present them, or should I store the results on the WordPress database? Ideally they would see a big table and have options to export to CSV, for example.
Thanks for your help and patience.
Cheers,
jack
There are a couple of possible ways this can be accomplished. One way is to just use webhooks. Most form plugins come with the option to use webhooks and doing it this way is pretty straightforward. Here is an article from WPForms on how to configure it WPForms and Webhooks. Below is an example of how I have used it. The example shows a form that sends data to AWS API Gateway which triggers AWS StepFunctions and also puts the customer information in DynamoDB
WPForms Webhook to AWS API Gateway

Twitch API Live Callback Service

I am integrating the Twitch user account API into my platform and had a look through the API to see if there was a callback section of some sort to send an update to my server when a user starts streaming, but I can't seem to find any reference for one.
Is there currently any services that offer this sort of thing? If not, what would be the best way of running regular checks on all of my users in my Database to see when they are streaming, of course doing this alone would kill the server with database queries, so I'm stuck as to where to go now.
What I am looking to do is receive a callback and then create a post in a social feed that the user has started streaming.
Based on the discussions at the links below, the API doesn't support webhooks and won't anytime soon. Instead, they expect you to use polling. Basically you would set up a worker process that makes requests periodically, such as every five minutes, then creates appropriate social feed posts, etc. You can batch them together if you have a bunch of channels to check (exaple from from the github issue):
https://api.twitch.tv/kraken/streams?channel=riotgames,dota2ti,machinima,esltv_hearthstone
https://github.com/justintv/Twitch-API/issues/211
https://discuss.dev.twitch.tv/t/notifications-using-twitch-api-and-php/1009

How to configure Rets server in local wordpress

I am trying to connect to MLS Rets server in my local wordpress but can't connect.
I also don't know how to use Rets Server and get data from there? Also need some real estate sample data for testing purpose.
Does Anybody have any idea. How can I do that.
Im not familiar with that wordpress plugin but you would get your login information and other details on connecting from the MLS that you are subscribed to. They could potentially have restricted access times or have IP restricted access among other general inconveniences causing you to not be able to connect.
Once connected, if you were looking for sample data then you would set your batch to a few hundred properties or something just to start. Or its possible that the MLS offers a sample set of data or a test server to use in developing your application.
to answer your comment
You have to be a member of one. Multiple Listing Services are organizations that realtors belong to in order to share their listing data through broker reciprocity. There are several hundred MLSes in the US alone and although many of them use the RETS standard (which really shouldnt be considered a 'standard' in the first place) there is absolutely nothing standardized about them beyond a few similarities here and there... im not sure about other countries... There is also a way to become an IDX vendor for MLSes.. This usually involves setup and monthly fees and strict approval processes.. In that case you would be selling your IDX service to a member of the MLS in question. If your not a realtor and just want to display listing data im pretty sure your going to have a hard time getting approved to do so.
You need to Connect RETS Service Provide they will give Credential once you register as agent under that agency and Provide Limited Access for RETS Data Feed once Again you can check your credential working or not using http://retsmd.com or if find any issue i having Script PHRETS and RETS IQ we will discuss if you facing any other issue.
To add to Andrew's answer - to get RETS credentials, you'll not only need to have an agent sign off for you, but you'll also need to get their broker in charge to approve it. Most agents choose to use a third party service that is already setup as a vendor since it can be a months or year long process for a new vendor to get setup and approved. Especially if that vendor doesn't already have standing relationships with other MLSs.
Some MLSs charge vendor fees that can range from $0 to as high as $5000 / month for access.

Google Spreadsheet API form PHP on a Cron Job

There is SO MUCH information about google APIs. So I'm getting lost in all the research.
My goal:
I have a spreadsheet under my google docs account. I want to run a cron job every day, pull cell values from a specific cell (it increases to the next row each day) and then do some other API calls to other services, then write the results in another column in that same row.
Most of the oAuth 2.0 stuff needs to ask the user, which can't happen in a cron job. I found something about a service account, but thats a whole new type of account, and it seems to have it's own credentials. I already have 4 types of security credentials created.
Question) How do I authenticate my google account in PHP without asking anything to the user?
The URL I want to use with cURL after authentication is this
https://spreadsheets.google.com/tq?tqx=out:json&tq=<QUERY>&key=<MY KEY>
Thanks to anyone who can help!

Google Checkout and PHPMyAdmin

I am creating a website with a google checkout link that lets customers purchase a digital product. This digital product is a credit to their account on the site. Therefore, I need to know how to make the completion of a google checkout order change a field in my PHPMyAdmin database. I would very much appreciate your answers.
phpMyAdmin is merely an administration interface to a database called mySQL.
Consider working through a basic PHP / mySQL tutorial first to get a fundamental understanding how these things work - especially if you're programming things in connection with commercial activity.
https://stackoverflow.com/questions/1610543/recommended-way-to-learn-php
However, a good and complete code sample that you could derive from can be found here:
Good tutorial on how to update your Mysql database with a PHP form?
You need to implement a web service on your server as described in the document Implementing the Notification API. You can do whatever you want in your web service when you receive a notification, including updating your data base.

Categories