Give dostadning permissions to upload a batch of auctions including images via tradera SOAP-api to your seller-account there.
While it does solve a concrete problem the main purpose was to explore mixing f# with c# code. The conclusion was that it is nice to write but managing dependencies when developing on OSX is awkward. The main reason for that is because f# needs mono. Got many cannot load this and that because reasons. Never got fsharpi to work with the entity framework code which was one of the things I was looking forward to. Maybe better experience on windows.
- Create an account with tradera developer center
- Export your credentials to environment variables:
export dostadning_tradera_appid=<Your application ID>
export dostadning_tradera_appkey=<Your application key>
export dostadning_tradera_pkey=<The public key>
- Set up a user "dostadning" with permissions to create a database on a postgresql instance. Store the connection string in an environment variable
export dostadning_records_pgres_cs="Host=localhost; Username=dostadning; Password=<the password>;"
- The frontend for dostadning is a simple cli. You run it most conveniently from
app/dostadning.cli
.dotnet run -- help
will list the commands.
- Postgresql 10.5 (I installed via
brew install postgres
). Dostadning needs a user named dostadning with permissions to create a database. Consult npgsql docs upon confusion.
Install dependencies:
dotnet restore
The interface is not super well-documented but you can look at the Commands.fs to work out what to do. Basically what you want is:
- Make a note of your tradera username
- Prepare a csv file with each auction you want to post to your seller. The file needs to have headers like in the example testdata. Images needs go into a filestructure wher they're in directories with the same id as the auction. Example in testdata.
- Create an account
- Add a tradera seller to your account
- Get consent to let dostadning post auctions to your account
- Upload a lot of auctions at once.
cd test/unit
then dotnet test
.
The tests are focused on proving that the composition of observables does the right things in the right order.