Get the oldest review date of an Udemy course, since they hide the course creation date.
Requires htmlq
and jq
.
Example usage:
$ ./udemy-oldest-review.sh graphql-with-react-course
2017-02-15T08:53:45-08:00
#!/bin/bash | |
course_slug=$1 | |
course_id=$(curl -s "https://www.udemy.com/course/$course_slug/" | htmlq -a data-clp-course-id body) | |
comment_count=$(curl -s "https://www.udemy.com/api-2.0/courses/$course_id/reviews/?courseId=$course_id&page=1" | jq '.count') | |
last_page=$(expr $comment_count / 12 + 1) | |
curl -s "https://www.udemy.com/api-2.0/courses/$course_id/reviews/?courseId=$course_id&page=$last_page&ordering=-created" | jq -r '.results[0].created' |