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

API call #1

Open
mr-eggleton opened this issue Mar 28, 2023 · 2 comments
Open

API call #1

mr-eggleton opened this issue Mar 28, 2023 · 2 comments

Comments

@mr-eggleton
Copy link
Contributor

rockstar = new RockstarApi() # can take url default is "https://rockstarapi-production.up.railway.app/"
rock=getRock(0) # calls  https://rockstarapi-production.up.railway.app/rock/0 

Which should get the following and return it into rock. and also print
''' bash
Rock 0 loaded .papa .my_array now available


``` json
{"id":0,"status":"success","code":"Shout \"Hello World\"!\npapa was a rolling stone\npapa was a brand new bag\nx is 2\nShout x\nLet my array at 0 be \"foo\"\nLet my array at 1 be \"bar\"\nLet my array at 2 be \"baz\"\nLet my array at \"key\" be \"value\"\nShout my array at 0\nShout my array at 1\nShout my array at 2\nShout my array at \"key\"\nShout my array\nGive back 1\n","log":{"papa":[175,1533],"x":[2],"my_array":[{"0":"foo"},{"0":"foo","1":"bar"},{"0":"foo","1":"bar","2":"baz"},{"0":"foo","1":"bar","2":"baz","key":"value"}]},"output":["Hello World",2,"foo","bar","baz","value",3]}
@mr-eggleton
Copy link
Contributor Author

Maybe the return of getRock is a dictionary combo of log and output.

https://docs.python.org/3/library/collections.html#collections.namedtuple so it can't be modified in foxdot?? We don't need the code. and success in the return value.

assert rs.getRock(0) == {"papa":[175,1533],"x":[2],"my_array":[{"0":"foo"},{"0":"foo","1":"bar"},{"0":"foo","1":"bar","2":"baz"},{"0":"foo","1":"bar","2":"baz","key":"value"}], "output":["Hello World",2,"foo","bar","baz","value",3]}

@mr-eggleton
Copy link
Contributor Author

Do we need to be able to get patterns????

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

1 participant