Posts

Post not yet marked as solved
1 Replies
806 Views
Hi I have been working with the Reporter API 2.2 outlined as per the documentation here https://help.apple.com/itc/contentreporterguide/en.lproj/static.html#itcbe21ac7db . Everything is working fine however I've noted that the access token has an expiry of 180 days, therefore I would like to automate the process of generating new tokens every so often so that I do not have to do this manually for the number of accounts that I am handling and plethora of reports i am pulling out. I've tried numerous methods to automate this but ultimately none has worked. The following tries result in an instant null response: echo "user pass" | java -jar Reporter.jar p=Reporter.properties Sales.generateToken echo "user\npass\n" | java -jar Reporter.jar p=Reporter.properties Sales.generateToken java -jar Reporter.jar p=Reporter.properties Sales.generateToken < credentials.txt (echo "user"; sleep 1; echo "pass") | java -jar Reporter.jar p=Reporter.properties Sales.generateToken So directly piping does not work. I also wrote a shell script using spawn expect send workflow, although it looks like the prompts are being answered in order, there is no output at the end: #!/usr/bin/expect spawn java -jar Reporter.jar p=Reporter.properties Sales.generateToken expect "username"; send "user\n"; expect "password"; send "pass\n"; I also tried to write a python script to achieve the same thing but seem to be getting to the same problem. Is this not allowed? Is there a workaround or native support? To me it doesnt seem like this command takes any additional arguments. Thanks
Posted
by pet3rxz.
Last updated
.
Post not yet marked as solved
0 Replies
311 Views
Hi. I've already posted a question about this 2 months ago but never got a response from anyone. I find it very hard to believe that no one has implemented a fully automated Sales scraping pipeline, so I would like to repeat my question as described here: https://developer.apple.com/forums/thread/660657 Essentially I would like to find out how it is possible to automate token generation for the sales api - as the tokens expire every 6 months and I dont fancy having to manually regenerate multitudes of tokens across multiple servers... Since directly piping values into the initialisation java -jar Reporter.jar p=Reporter.properties Sales.viewToken results in null, I have figured out the implementation is using Console.readPassword() (https://stackoverflow.com/a/45477249/7691338 ), so I am wondering if there is a workaround for this at all? I've wasted a lot of time trying to automate this, env variables, piping, feeding from a temporary file, NOTHING seems to work. Please, someone, help. I found several people's data scraping implementation, but this is the thing I have not seen ANYONE solve. Perhaps this means that the developers did this intentionally, or it is a bug that's never been raised? Thanks
Posted
by pet3rxz.
Last updated
.