sasori Posted November 7, 2015 Share Posted November 7, 2015 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 https://go.developer.ebay.com/ 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?, Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted November 7, 2015 Share Posted November 7, 2015 (edited) 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 November 7, 2015 by Jacques1 Quote Link to comment Share on other sites More sharing options...
sasori Posted November 7, 2015 Author Share Posted November 7, 2015 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 Quote Link to comment Share on other sites More sharing options...
maxxd Posted November 7, 2015 Share Posted November 7, 2015 What's the overall goal here? Because honestly, it kinda sounds shady. Quote Link to comment Share on other sites More sharing options...
Barand Posted November 7, 2015 Share Posted November 7, 2015 I suspect the real question is "How can I bombard sites with spam?" Quote Link to comment Share on other sites More sharing options...
maxxd Posted November 7, 2015 Share Posted November 7, 2015 That's my question. I'm not judging, and the intent may be completely benign, but it sounds like "Help me create a CSRF script, please". Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted November 7, 2015 Share Posted November 7, 2015 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. Quote Link to comment Share on other sites More sharing options...
sasori Posted November 8, 2015 Author Share Posted November 8, 2015 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... Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted November 8, 2015 Share Posted November 8, 2015 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. Quote Link to comment Share on other sites More sharing options...
sasori Posted November 8, 2015 Author Share Posted November 8, 2015 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. )) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.