|
|
Running myIbay with parameters | Thu Sep 22, 2011 01:35 AM | | |
|
esb1922 |
Guest |
|
|
Hi,
I've been developing a software and a part of it is searching on ebay. What I suggest that it'd be nice if your app could accept parameters and be called as a process directly from another software, something like
myibay.exe myEbayId, myEbayPassword, EbayItemId (optional)
I'm petty sure that should be easy to implement and also that would bring you more customers.
What do you think?
|
|
|
| Thu Sep 22, 2011 03:31 AM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
I don't think that will bring more customers, but you can implement using your browser or some http-based client like wget or curl.
You can make two calls: login once, save the session cookies and additem with the new cookie as many times as you need.
|
|
|
| Fri Sep 23, 2011 01:12 PM | | |
|
esb1922 |
Guest |
|
|
My app is the windows app not web and I also use your standalone version not web-based.
As for the customers, I meant if I had such feature, some of my clients would want to buy myibay.
|
|
|
| Fri Sep 23, 2011 06:28 PM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
You have to have Internet connection for the app to work.
The Windows app connects to the Web server anyway, so you may want to skip this extra dependency to avoid the unneccessary latency for your app.
Also, it's free.
|
|
|
| Sat Sep 24, 2011 02:02 PM | | |
|
esb1922 |
Guest |
|
|
I still prefer to call the windows app. Basically I don't even ask to snipe automatically - all I ask is to get parameters and populate text boxes on load. As simple as that.
|
|
|
| Sat Sep 24, 2011 05:09 PM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
That's not so simple to implement actually.
All parameters are transferred over network and not over command line parameters, multiple instances of app do not talk to each other if you need to add several items sequentially. There are other complications too.
I can give you an example of the script to do it over Web, that's really easy. You should always try the easiest methods first. The simpler your design, the more reliable it is (KISS method does its magic).
|
|
|
| Sat Sep 24, 2011 09:07 PM | | |
|
esb1922 |
Guest |
|
|
that would be nice if you provide an example of the script, Will wait for that. Thx
|
|
|
| Sun Sep 25, 2011 12:27 AM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
I need some info on your app. If a language does not matter, I can provide a generic script. Let me know.
|
|
|
| Sun Sep 25, 2011 05:57 PM | | |
|
esb1922 |
Guest |
|
|
C#, VS2010
Thanks
|
|
|
| Sun Sep 25, 2011 06:07 PM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
|
|
|
| Sun Oct 23, 2011 01:22 AM | | |
|
|
Guest |
|
|
sorry, I've been sick and could only now get back to this task. Unfortunately I can't even get a response after I POST to login. I used suppesedly working code from the Internet but something goes wrong. I guess I shouldn't post the code here. Is there anyway you could take a look at the code?
|
|
|
| Sun Oct 23, 2011 04:06 AM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
I don't think I can take a look if you can't post your code here.
You can also ask on .Net-related forums if you like to get a better response from someone who does .Net on daily basis.
This "POST" call is pretty generic and not specific to Myibidder anyway.
|
|
|
| Sun Oct 23, 2011 05:48 AM | | |
|
esb1922 |
Guest |
|
|
That's not what I meant. I can post the code here if you don't mind...
string strURL = "https://www.myibidder.com/login";
string postData = "login=" + myId + "&password=" + myPwd;
HttpWebRequest request = null;
byte[] byteArray;
CookieContainer cookieContainer = new CookieContainer();
for (int i = 0; i < 2; i++)
{
request = (HttpWebRequest)WebRequest.Create(strURL);
request.Method = "POST";
byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
if (i == 1)
request.CookieContainer = cookieContainer;
using (Stream dataStream = request.GetRequestStream())
{
dataStream.Write(byteArray, 0, byteArray.Length);
}
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
if (i == 1)
break;
foreach (Cookie cookie in response.Cookies)
{
cookieContainer.Add(cookie);
}
using (Stream responseStream = response.GetResponseStream())
{
using (StreamReader reader = new StreamReader(responseStream))
{
string responseFromServer = reader.ReadToEnd();
}
}
}
strURL = "https://www.myibidder.com/main";
postData = "additem_itemid=110759565141&additem_mybid=24";
}
I agree it's pretty generic and it has been taken from the other forum. I actually tried many samples and none of them works or I do something wrong. Thanks anyway
|
|
|
| Sun Oct 23, 2011 04:03 PM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
Your POST data has wrong parameters. Check the html page of the form on Myibidder to get the correct parameters.
Also, why you do it in for loop? Just one single request is good enough.
|
|
|
| Sun Oct 23, 2011 05:07 PM | | |
|
esb1922 |
Guest |
|
|
I actually also tried
https://www.myibidder.com/login
login=esb1922&pass=XXXXX
and
https://www.myibidder.com/main
newid=110759565141&mybid=24&groupid=0
with the same result.
Not sure how to do it with a single request - I'm not good with web classes and forums don't help. I used a loop because I thought I could login and snipe at the same time.
|
|
|
| Sun Oct 23, 2011 05:12 PM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
You gave me two different requests. You can't expect the same result from them.
What do you get when you do login?
The for loop is mainly for identical repeatable procedures. You should not put different things in the same loop -- your code is not readable.
|
|
|
| Sun Oct 23, 2011 05:32 PM | | |
|
esb1922 |
Guest |
|
|
"What do you get when you do login? "
Just the front page
|
|
|
| Sun Oct 23, 2011 05:38 PM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
Did you try it in your browser?
https://www.myibidder.com/login?login=esb1922&pass=XXXXX
|
|
|
| Sun Oct 23, 2011 05:45 PM | | |
|
esb1922 |
Guest |
|
|
yep - works fine
|
|
|
| Sun Oct 23, 2011 06:28 PM | | |
|
Sashka |
Support |
|
Posts: 3792 |
Member Since: Feb 13, 2008 |
Location: www.myibidder.com |
|
Then check how you get and process cookies. I think this is where you problem is.
When you login, you should get some session cookies. You must give the same cookies back to the server when adding a new snipe.
|
|
|