I want to make a market where I periodically reveal new information. The best way I know of is to use the API to add comments to the market. I also want pictures there. Will I succeed in automating this task?
I'll be closing this in around a week. If I succeed before this (to my satisfaction), this resolves YES and if I don't succeed in this time frame, this resolves NO. I'll likely spend at least a couple of hours attempting this. This market won't resolve N/A.
🏅 Top traders
# | Name | Total profit |
---|---|---|
1 | Ṁ97 | |
2 | Ṁ48 | |
3 | Ṁ21 | |
4 | Ṁ9 | |
5 | Ṁ3 |
People are also trading
So what I'd want to do is:
Goal: Have a market based on the idea of "reveal new information every hour".
Approach: I have a file data.txt, from which I reveal this information. Each hour, do a POST-request via the Manifold API to do a comment to the market containing the new information.
[Ideally, I'd edit the description, but the API doesn't support that. One could have a totally separate system for this thing, e.g. a website, but I'm unfortunately not yet a skilled enough programmer to do this.]
What I tried (unsuccessfully): I wrote a bash script containing a part
curl https://manifold.markets/api/v0/comment -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Key 123456-blah-blah-blah' \
--data-raw '{"contractId":"iQMXhHXTOOnJ0J3SqvUY", "markdown":$STR}'
where STR is the thing I read from data.txt. However, doing this simply results in a comment reading "$STR" (see below). (Reading the file, sleeping for an hour, etc. seemed like something I am able to do, the issue is putting variables in the POST-request.)
I Googled a bit but couldn't quickly get around this. Also feeling like this whole "post a comment every hour" business is not the cleanest solution.
@Loppukilpailija Would you mind using python? Working with variables like STR is much more straight forward there. I just created this and it works: https://drive.google.com/file/d/15MBmzgC0Jqf5aaZDWCf2ephqJb7szvvo/view?usp=drive_link
@nanob0nus You can either schedule the comments manually with three lines of code per comment or read them from a file there with a loop
@nanob0nus Sure, any solution is fine, including Python. Note that the Drive file you linked needs permission to access it
Not satisfied yet. What I would want to do is (roughly) to be able to read a file, post a comment with the first N characters of the file, N += 1, wait, repeat. I didn't succeed yet. I might look into it later on, but as of now the market would resolve NO.