Jump to content

how to cross post when target site has no open API endpoint?


Recommended Posts

Hi,

 

Is it possible to cross post some data to a target site even if the target has not open API end point? let's say for example 

the ebay.com website. They have an API for developers to use 

and I think it's easy to post some data/ads to their site because of this maybe by just using CURL of php..

but what if my real target website doesn't have open API?, is it possible to do that in PHP?. can someone give me a short snippet

how to do that if possible?, 

So the target website has a form, and instead of manually filling out that form, you want to send the data automatically? Yes, this can theoretically be done with cURL.

 

If this form is only accessible to authenticated users, you'll have a hard time automating the process, because you need to maintain a session and probably even scrape the anti-CSRF token from the form before you're allowed to do anything. If the form is public, it's a bit easier. Either way, your program may break at any time, because the website owner might change the input parameters.

 

What exactly are you trying to achieve?

Edited by Jacques1

So the target website has a form, and instead of manually filling out that form, you want to send the data automatically? Yes, this can theoretically be done with cURL.

 

If this form is only accessible to authenticated users, you'll have a hard time automating the process, because you need to maintain a session and probably even scrape the anti-CSRF token from the form before you're allowed to do anything. If the form is public, it's a bit easier. Either way, your program may break at any time, because the website owner might change the input parameters.

 

What exactly are you trying to achieve?

That's the exact thing I want to achieve from my first post, I only used ebay as an example. Because my real target website that is similar to ebay, has no open API end point at all. And yes, the target website has a form, but, one needs to login before being able to post anything, can you give me a sample snippet on how to do it via cURL ?..I know how to use curl, but I just wanna see how others will do it

There are perfectly legitimate use cases for automated form submission. Sometimes a website simply doesn't have an official API.

 

But, yeah, the problem description needs to be a lot more specific.

 

sasori, why don't you give it a shot? The Internet is already full of code snippets, so that shouldn't be the problem. If you run into an issue, post your code and tell us what exactly you don't understand.

ok I'll tell the real score why I came up with this question..it's because one of my colleague asked me to experiment and create a platform that can do cross posting to other shopping sites, so that sellers can use it and ease the pain of opening tabs of different sites and posting again and again...

Yeah, well, that's not really a good idea.

 

Web scraping is OK for one-off tasks. But you wouldn't build an entire platform around a very fragile and very unofficial hack. You may actually get in trouble with the shop owners, because not everybody is OK with bots posting data. And even if you're allowed to do it, you get zero stability. The forms will probably change all the time, and that means your tools will break all the time and require manual updates. Sounds like a nightmare.

 

So before you jump to the technical implementation, you should clarify some conceptual questions. Are you even allowed to do this? Is everybody willing to accept the problems of this approach? Is there really no better way like a basic API? etc.

 

In any case, this is way beyond the capabilities of a help forum. You'll need a lot more than a beginner's tutorial for cURL.

Yeah, well, that's not really a good idea.

 

Web scraping is OK for one-off tasks. But you wouldn't build an entire platform around a very fragile and very unofficial hack. You may actually get in trouble with the shop owners, because not everybody is OK with bots posting data. And even if you're allowed to do it, you get zero stability. The forms will probably change all the time, and that means your tools will break all the time and require manual updates. Sounds like a nightmare.

 

So before you jump to the technical implementation, you should clarify some conceptual questions. Are you even allowed to do this? Is everybody willing to accept the problems of this approach? Is there really no better way like a basic API? etc.

 

In any case, this is way beyond the capabilities of a help forum. You'll need a lot more than a beginner's tutorial for cURL.

 

But it's not actually a bot..the concept of the proposed experiment, was , enable the user to login in within that platform, and choose the shops that he/she like to have his/her ad posted by just filling up a form and one click of a submit button. But still I find it hard. I've already tried cURLing in one of the target sites and since it has no api available I failed already. :)))

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.