Comments (2)
@bobMuk generally I suggest starting with the show_queue() function (-q option).
Just copy+paste one of the cURL commands.
For lists, you will want to query
/api/namedLists (shopping + to-do list)
/api/lists/linkedPartners (no idea)
/api/lists/fetchUserPreference
/api/namedLists//items (actual content of a list)
Alex
from alexa-remote-control.
Thanks. After I posted the question I did some googling of the API and stopped generally being lazy... though I am still too lazy to "officially" contribute to the project.
But if anyone wants it, I've created list functions:
-listlist -getlist listname
Here's a diff of my changes against v0.10b of the script:
diff alexa_remote_control.sh.old alexa_remote_control.sh 101a102,103 > GETLIST="" > LISTLIST="" 263a266,273 > -getlist) > GETLIST="true" > RETRIEVELIST=$2 > shift > ;; > -listlist) > LISTLIST="true" > ;; 747a758,786 > # list functions > # > list_list () > { > ${CURL} ${OPTS} -s -b ${COOKIE} -A "Mozilla/5.0" -H "DNT: 1" -H "Connection: keep-alive" -L\ > -H "Content-Type: application/json; charset=UTF-8" -H "Referer: https://alexa.${AMAZON}/spa/index.html" -H "Origin: https://alexa.${AMAZON}"\ > -H "csrf: $(awk "\$0 ~/.${AMAZON}.*csrf[ \\s\\t]+/ {print \$7}" ${COOKIE})" -X GET \ > "https://${ALEXA}/api/namedLists" | jq '.lists[] | .type' | sed -e 's/"//g' > } > > > get_list () > { > #first get list ID from supplied name > mylistid=$(${CURL} ${OPTS} -s -b ${COOKIE} -A "Mozilla/5.0" -H "DNT: 1" -H "Connection: keep-alive" -L -H "Content-Type: application/json; charset=UTF-8" -H "Referer: https://alexa.${AMAZON}/spa/index.html" -H "Origin: https://alexa.${AMAZON}" -H "csrf: $(awk "\$0 ~/.${AMAZON}.*csrf[ \\s\\t]+/ {print \$7}" ${COOKIE})" -X GET "https://${ALEXA}/api/namedLists" | jq '.lists[] | select(.type == "'$RETRIEVELIST'") | .itemId' | sed -e 's/"//g') > if [ -z $mylistid ] > then > echo "Could not identify list $RETRIEVELIST" > return 1 > fi > > #get list contents > ${CURL} ${OPTS} -s -b ${COOKIE} -A "Mozilla/5.0" -H "DNT: 1" -H "Connection: keep-alive" -L\ > -H "Content-Type: application/json; charset=UTF-8" -H "Referer: https://alexa.${AMAZON}/spa/index.html" -H "Origin: https://alexa.${AMAZON}"\ > -H "csrf: $(awk "\$0 ~/.${AMAZON}.*csrf[ \\s\\t]+/ {print \$7}" ${COOKIE})" -X GET \ > "https://${ALEXA}/api/namedLists/$mylistid/items" | jq '.list[] | select(.completed == false) | .value' | sed -e 's/"//g' > } > > # 760c799 < if [ -z "$LASTALEXA" -a -z "$BLUETOOTH" -a -z "$LEMUR" -a -z "$PLIST" -a -z "$HIST" -a -z "$SEEDID" -a -z "$ASIN" -a -z "$PRIME" -a -z "$TYPE" -a -z "$QUEUE" -a -z "$LIST" -a -z "$COMMAND" -a -z "$STATIONID" -a -z "$SONG" -a -n "$LOGOFF" ] ; then --- > if [ -z "$LISTLIST" -a -z "$GETLIST" -a -z "$LASTALEXA" -a -z "$BLUETOOTH" -a -z "$LEMUR" -a -z "$PLIST" -a -z "$HIST" -a -z "$SEEDID" -a -z "$ASIN" -a -z "$PRIME" -a -z "$TYPE" -a -z "$QUEUE" -a -z "$LIST" -a -z "$COMMAND" -a -z "$STATIONID" -a -z "$SONG" -a -n "$LOGOFF" ] ; then 889a929,932 > elif [ -n "$GETLIST" ] ; then > get_list > elif [ -n "$LISTLIST" ] ; then > list_list
from alexa-remote-control.
Related Issues (20)
- Two issues Cannot find jq and cannot refresh token HOT 2
- how to use "sound:<soundeffect_name>" HOT 4
- Tunein Jingle HOT 8
- "Phantom" device, how to remove?
- Seems answer from "-lastalexa" is changed by Amazon HOT 2
- 20220617 - "Strange" REFRESH_TOKEN generated by alexa-cookie-cli HOT 2
- Trouble Installing HOT 1
- setting default device to: ERROR: unknown device dev: HOT 10
- <InternalFailure/> from Play & Pause // parse error from jq? HOT 6
- Multiple errors "date: invalid date" HOT 14
- Can't get the script to speak HOT 5
- Old Linux Distri with jq 1.4 and curl 7.38 script error with solution ;-)
- Initial login page has changed HOT 2
- Failed writing body HOT 2
- ERROR: cookie retrieval with refresh_token didn't work HOT 2
- Error -lastalexa and -last command HOT 20
- Login procedure does not work anymore (even with new uri) HOT 2
- alexa_remote_control.sh dosn't recieve a cookie anymore... HOT 2
- Return code for commands given to alexa-remote-control HOT 1
- no idea how to use it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alexa-remote-control.