All Projects → ginglis13 → cat-message

ginglis13 / cat-message

Licence: MIT license
Finds cat images/videos/gifs on reddit, sends them to my mom via applescript

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to cat-message

subreddit-comments-dl
Download subreddit comments
Stars: ✭ 57 (+62.86%)
Mutual labels:  scraper, reddit
scripts
A collection of random scripts I coded up
Stars: ✭ 17 (-51.43%)
Mutual labels:  scraper, reddit
saveddit
Bulk Downloader for Reddit
Stars: ✭ 130 (+271.43%)
Mutual labels:  scraper, reddit
Redditdownloader
Scrapes Reddit to download media of your choice.
Stars: ✭ 521 (+1388.57%)
Mutual labels:  scraper, reddit
Skraper
Kotlin/Java library and cli tool for scraping posts and media from various sources with neither authorization nor full page rendering (Facebook, Instagram, Twitter, Youtube, Tiktok, Telegram, Twitch, Reddit, 9GAG, Pinterest, Flickr, Tumblr, IFunny, VK, Pikabu)
Stars: ✭ 72 (+105.71%)
Mutual labels:  scraper, reddit
Media Scraper
Scrapes all photos and videos in a web page / Instagram / Twitter / Tumblr / Reddit / pixiv / TikTok
Stars: ✭ 206 (+488.57%)
Mutual labels:  scraper, reddit
Spam Bot 3000
Social media research and promotion, semi-autonomous CLI bot
Stars: ✭ 79 (+125.71%)
Mutual labels:  scraper, reddit
RedditExtractor
A minimalistic R wrapper for the Reddit API
Stars: ✭ 58 (+65.71%)
Mutual labels:  scraper, reddit
web-crawler
Python Web Crawler with Selenium and PhantomJS
Stars: ✭ 19 (-45.71%)
Mutual labels:  scraper
gochanges
**[ARCHIVED]** website changes tracker 🔍
Stars: ✭ 12 (-65.71%)
Mutual labels:  scraper
Facebook-Profile-Pictures-Downloader
😆 Download public profile pictures from Facebook.
Stars: ✭ 23 (-34.29%)
Mutual labels:  scraper
reddit
Reddit client for Bobby B Bot
Stars: ✭ 62 (+77.14%)
Mutual labels:  reddit
scrapy-LBC
Araignée LeBonCoin avec Scrapy et ElasticSearch
Stars: ✭ 14 (-60%)
Mutual labels:  scraper
Website-downloader
💡 Download the complete source code of any website (including all assets). [ Javascripts, Stylesheets, Images ] using Node.js
Stars: ✭ 615 (+1657.14%)
Mutual labels:  scraper
Reddnet
🎭 Minimal Reddit clone
Stars: ✭ 125 (+257.14%)
Mutual labels:  reddit
telepooz
Functional Telegram Bot API wrapper for Scala on top of akka, circe, cats, and shapeless
Stars: ✭ 26 (-25.71%)
Mutual labels:  cats
tinyPornManager
Made for pornhub. Fork from tinyMediaManager v3
Stars: ✭ 57 (+62.86%)
Mutual labels:  scraper
stweet
Advanced python library to scrap Twitter (tweets, users) from unofficial API
Stars: ✭ 287 (+720%)
Mutual labels:  scraper
ColegaDondeEstaMiTFM
Un bot de Twitter que comparte cada hora un TFM hasta que Cristina Cifuentes enseñe el suyo.
Stars: ✭ 14 (-60%)
Mutual labels:  scraper
influencer-stats
Playground for measuring performance of functional programming tools in Scala. Gathers statistics about videos.
Stars: ✭ 24 (-31.43%)
Mutual labels:  cats

cat-message

gets images/gifs/videos of cats from reddit, sends to mom via an Applescript.

get_cats.py

As 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.

msg_cat.scpt

This 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:

# to customize: change the things in all caps
# PATH_TO_REPOSITORY, RECIPIENT_PHONE_NUMBER, YOUR_APPLE_ID

# ginglis

on run argv
	# find the cat file
	set path_to_file to do shell script "find PATH_TO_REPOSITORY -mindepth 1 -name 'cat*'"

	# set it as a POSIX file
	set my_file to (path_to_file as POSIX file)

	set post_title to (item 1 of argv)

	# send stuff
	tell application "Messages"
		set theBuddy to buddy "RECIPIENT_PHONE_NUMBER" of service "E:YOUR_APPLE_ID"
		send post_title to theBuddy
		send my_file to theBuddy
	end tell
end run

As 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.

run.sh

This 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.

Subreddits

Checklist

  • Find and save images
  • Handle gyfcat
  • Handle imgur
  • Handle YouTube
  • Applescript to send iMessage
  • Include the post title in iMessage
  • Comment Code, clean up, document

Shortcomings

Unfortunately, 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].