If you'd like to contact me please looked at my ReadMe on how to reach me.
An example. https://open.spotify.com/playlist/2vwgqcsUDuXbAdevQvthTi
All sections regarding this repository.
If you'd like to recreate this program, you can access the extensions folder and then the discussionreplies.py file. You will have to change the group and discussion id's to your specific discussion.
https://xxxx.instructure.com/groups/12345/discussion_topics/1234567
The 5 digit is your group id. The 7 digit is your discussion id.
course = canvas.get_group(12345)
def getreplies():
#saves discussion object into var
disc = course.get_discussion_topic(1234567)
#gets entries of discussion object
y = disc.get_topic_entries()
# changes pagnated list to iterable and sliceable one
iterables = [str(i) for i in y]
final = []
# for loops that removes html tags and removes student number from back
for i, unclean in enumerate(iterables):
reply = cleanhtml(unclean)
l = len(reply)
removenumber = reply[:l-10]
finalstring = removenumber.replace('SONG:', '')
final.append(finalstring)
Make sure to put in your own ID's that way you can fetch the replies of the discussion.
This program allows a user to read a discussion in canvas, and retrieve its entries, a discussion with replies of song names will be broken up into a list and searched by the spotify api, this is then added to the playlist, it does not allow duplicate songs to be added
- JSON
- Spotify API
- CanvasAPI
To be able to execute this code you will need these modules: SEE REQUIREMENTS.TXT FOR MODULES
- Make sure
requirements.txt
is in your environment. - cd to your directory where the file is.
- run the command
pip install -r requirements.txt
in your shell.
# Import the Canvas class
from canvasapi import Canvas
# Canvas API URL
API_URL = "https://example.com"
# Canvas API key
API_KEY = "p@$$w0rd"
# Initialize a new Canvas object
canvas = Canvas(API_URL, API_KEY)
- Spotify API Docs
- Canvas API Docs
- JSON Docs
MIT License
Copyright (c) [2022] [Carson Fulmer]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- LinkedIn - Carson Fulmer
- Website - Carson Fulmer