Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to list copied positions? #27

Open
mortenscheel opened this issue Feb 6, 2021 · 8 comments
Open

Ability to list copied positions? #27

mortenscheel opened this issue Feb 6, 2021 · 8 comments

Comments

@mortenscheel
Copy link
Contributor

I copy a bunch of people on eToro, and I'm trying to create a summary containing all my currently copied positions.

By inspecting the requests, I've figured out that all the data I need is included in the response from the logindata endpoint. Would it be possible to add an endpoint to expose this data?

In case anyone is interested, this is where the data about "Mirrors" can be found in the response from logindata:
List of Mirrors containing names and avatars: AggregatedResult.ApiResponses.MirrorsUserData.Content.users[]
Lists of copied positions: AggregatedResult.ApiResponses.PrivatePortfolio.Content.ClientPortfolio.Mirrors[].Positions

@mortenscheel
Copy link
Contributor Author

Just to follow up, I've forked the project and added the functionality I needed: https://github.com/mortenscheel/etoro-api.

Let me know if you'd be interested in a pull request. This is my first experience with Kotlin, so I'd probably need some help cleaning thigs up though.

@ok24601
Copy link
Owner

ok24601 commented Feb 13, 2021

hi,
thanks for your contribution, i'm going to merge your changes into master

@ok24601
Copy link
Owner

ok24601 commented Feb 13, 2021

it's merged now, thanks again

@mortenscheel
Copy link
Contributor Author

No problem. I've pushed a few changes to the fork, in case you want to get those as well.
I assume you'll review the code before tagging a new release? Like I said, I've never worked with Kotlin before, and it's been years since I did anything in Java.

Also, I should mention that the Dockerfile is taken from https://github.com/JustinGuese/docker-etoro-api which was mentioned in #26

@ok24601
Copy link
Owner

ok24601 commented Feb 13, 2021

btw i found issue with mirror controller, it fails if there is no mirrors in your login data, it also doen't work for 'Demo' mode

@ok24601
Copy link
Owner

ok24601 commented Feb 13, 2021

will commit fixes

@mortenscheel
Copy link
Contributor Author

Thanks. I don't know how to implement Demo mode for Mirrors. Should it just return an empty array?

I've pushed an update that simplifies a few thing. I've dropped caching of mirror data, and made mirror_id optional in /mirrors/positions.

Regarding code style, do you know how I can make Idea use the standard you're using?

@ok24601
Copy link
Owner

ok24601 commented Feb 15, 2021

hi, i don't use any settings other than default for kotlin, just doint shift+ctrl+options+L with 3 checkboxes for code format.
btw demo is already implemented in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants