Usage
Available function:
- fetch()
#
Usageuse arifszn\RedditImageFetcher\RedditImageFetcher;
$redditImageFetcher = new RedditImageFetcher(); $result = $redditImageFetcher->fetch('meme'); // fetch 1 meme$result = $redditImageFetcher->fetch('wallpaper'); // fetch 1 wallpaper
$result = $redditImageFetcher->fetch('wallpaper', 50); // fetch 50 wallpapers // custom image fetch from given subreddits$result = $redditImageFetcher->fetch( 'custom', 50, ['cats', 'Catswhoyell', 'sleepingcats']); // fetch 50 cat images from custom subreddit library $result = $redditImageFetcher->fetch( 'meme', 50, [], ['memes', 'funny'], ['dankmemes']); // fetch 50 memes by adding two subreddits and removing 1 subreddit from default subreddit library
#
ResultFetching
#
OptionsProperty | Type | Description | Default |
---|---|---|---|
type | string | 'meme' | 'wallpaper' | 'custom' | 'meme' |
total | int | How many images to get. Max is 50 | 1 |
subreddit | array | Custom subreddit libray | [ ] |
addSubreddit | array | Add subreddits to subreddit library | [ ] |
removeSubreddit | array | Remove subreddits from subreddit library | [ ] |