Skip to content

Instantly share code, notes, and snippets.

@mkraft
Last active February 15, 2023 12:52
Show Gist options
  • Save mkraft/784d2cf7204c53b3636f9dd84525632b to your computer and use it in GitHub Desktop.
Save mkraft/784d2cf7204c53b3636f9dd84525632b to your computer and use it in GitHub Desktop.
Get the oldest review date of an Udemy course.

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment