{"id":17844088,"url":"https://github.com/ginglis13/cat-message","last_synced_at":"2025-09-05T08:32:14.489Z","repository":{"id":104555783,"uuid":"187316197","full_name":"ginglis13/cat-message","owner":"ginglis13","description":"Finds cat images/videos/gifs on reddit, sends them via applescript","archived":false,"fork":false,"pushed_at":"2019-10-12T13:00:36.000Z","size":7014,"stargazers_count":38,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-29T16:45:58.045Z","etag":null,"topics":["applescript","cats","hacktoberfest","imessage","macos","python3","reddit","scraper"],"latest_commit_sha":null,"homepage":"https://ginglis.me/cat-message/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ginglis13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-18T04:59:11.000Z","updated_at":"2024-05-19T12:21:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"e64fedae-dcbe-4056-9aa7-9cc539802e4c","html_url":"https://github.com/ginglis13/cat-message","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginglis13%2Fcat-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginglis13%2Fcat-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginglis13%2Fcat-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginglis13%2Fcat-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ginglis13","download_url":"https://codeload.github.com/ginglis13/cat-message/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232032088,"owners_count":18462969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applescript","cats","hacktoberfest","imessage","macos","python3","reddit","scraper"],"created_at":"2024-10-27T21:27:59.634Z","updated_at":"2024-12-31T21:49:24.781Z","avatar_url":"https://github.com/ginglis13.png","language":"Python","readme":"# cat-message\ngets images/gifs/videos of cats from reddit, sends to mom via an Applescript.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"demo.gif\" /\u003e\n\u003c/p\u003e\n\n## get_cats.py\n\nAs the name of the file suggests, this script is for finding cat media posts on reddit and downloading these posts to the working directory. The script names each file `cat.[relevant extension]`, and before writing this file, the script deletes each file named `cat.*`. There are a few shortcomings to this file as are outlined in the section titled Shortcomings. If the script runs into any errors/can't get the media type, a message is printed to `stderr`.\n\n## msg_cat.scpt\n\nThis is the Applescript for sending a cat file to the recipient of your choice. Since GitHub doesn't really deal with Applescripts very well, the entire script is copied below:\n\n```applescript\n# to customize: change the things in all caps\n# PATH_TO_REPOSITORY, RECIPIENT_PHONE_NUMBER, YOUR_APPLE_ID\n\n# ginglis\n\non run argv\n\t# find the cat file\n\tset path_to_file to do shell script \"find PATH_TO_REPOSITORY -mindepth 1 -name 'cat*'\"\n\n\t# set it as a POSIX file\n\tset my_file to (path_to_file as POSIX file)\n\n\tset post_title to (item 1 of argv)\n\n\t# send stuff\n\ttell application \"Messages\"\n\t\tset theBuddy to buddy \"RECIPIENT_PHONE_NUMBER\" of service \"E:YOUR_APPLE_ID\"\n\t\tsend post_title to theBuddy\n\t\tsend my_file to theBuddy\n\tend tell\nend run\n```\n\nAs you can see from the comments, the three elements of the script to change in order to get it to work are `PATH_TO_REPOSITORY`, `RECIPIENT_PHONE_NUMBER`, and `YOUR_APPLE_ID`. Of course, in order to run this script, you must be using a Mac and have an Apple ID.\n\n## run.sh\n\nThis is a short and simple shell script I made just to consolidate the Python script and the Applescript to essentially one script. It simply runs `get_cats.py`, captures the output (the post title), and passes this output as an argument to the Applescript, which sends the post title in addition with the post media. I run this script on a cronjob that executes daily.\n\n## Subreddits\n\n- [cats](https://www.reddit.com/r/cats)\n- [catsstandingup](https://www.reddit.com/r/catsstandingup)\n- [catslaps](https://www.reddit.com/r/catslaps)\n- [catsareassholes](https://www.reddit.com/r/catsareassholes)\n- [chonkers](https://www.reddit.com/r/chonkers)\n- [bigcatgifs](https://www.reddit.com/r/bigcatgifs)\n- [babybigcatgifs](https://www.reddit.com/r/babybigcatgifs)\n- [holdmycatnip](https://www.reddit.com/r/holdmycatnip)\n- [catsISUOTTATFO](https://www.reddit.com/r/CatsISUOTTATFO/)\n- [catsareliquid](https://www.reddit.com/r/catsareliquid/)\n- [catloaf](https://www.reddit.com/r/catloaf/)\n\n## Checklist\n\n- [X] Find and save images\n- [X] Handle gyfcat\n- [X] Handle imgur\n- [ ] Handle YouTube\n- [X] Applescript to send iMessage\n- [X] Include the post title in iMessage\n- [ ] Comment Code, clean up, document\n\n## Shortcomings\n\nUnfortunately, requesting videos from reddit (sources that include `v.redd.it`) resulted in reddit detecting that a script was making too many requests to the site. Since posts of that format from these subreddits seems to be a rarity, I will not be attempting a workaround. Also, no implementation has been made for YouTube posts. My reasononing for not finding a workaround to these issues is that the rate of finding other media types is high enough to justify the script not working occasionally when it finds media from these sources. I use this once a day to send a cat to my mom, and if on one day it doesn't work, it's not a huge deal.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fginglis13%2Fcat-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fginglis13%2Fcat-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fginglis13%2Fcat-message/lists"}