Skip to content

Instantly share code, notes, and snippets.

@ldante86
Created November 9, 2016 06:30
Show Gist options
  • Save ldante86/104e6f29a1bcc7b4f115f094b610cafd to your computer and use it in GitHub Desktop.
Save ldante86/104e6f29a1bcc7b4f115f094b610cafd to your computer and use it in GitHub Desktop.
get reddit karma numbers for user
#!/bin/bash -
reddit_user="$1"
echo
echo "karma for /u/${reddit_user}"
echo
page=$(lynx -source "https://www.reddit.com/user/${reddit_user}/")
echo -n "post karma: "
echo "$page"| grep -io "<span class=\"karma\">*[0-9,]*" | sed 's/.*>//'
echo -n "comment karma: "
echo "$page"| grep -io "<span class=\"karma comment-karma\">*[0-9,]*" | sed 's/.*>//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment