From 7f115f3d68caf7ae1b82986c80b87a6aa8f5d324 Mon Sep 17 00:00:00 2001 From: Ceda EI <19731116+Ceda-EI@users.noreply.github.com> Date: Mon, 2 Apr 2018 01:59:07 +0530 Subject: [PATCH] Delete .gitignore, composer.json, downloader.php --- .gitignore | 2 -- composer.json | 5 ----- downloader.php | 46 ---------------------------------------------- 3 files changed, 53 deletions(-) delete mode 100644 .gitignore delete mode 100644 composer.json delete mode 100755 downloader.php diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d1502b0..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -composer.lock diff --git a/composer.json b/composer.json deleted file mode 100644 index 11acbd8..0000000 --- a/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "crewlabs/unsplash": "^2.4" - } -} diff --git a/downloader.php b/downloader.php deleted file mode 100755 index 6639774..0000000 --- a/downloader.php +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env php - file_get_contents(getenv('HOME').'/i3lock-delta/api_key'), - 'utmSource' => 'i3lock-Delta' -]); - -# Get custom search queries -$queries_file_name = getenv('HOME') . '/.config/lock_preferences'; -$queries = file($queries_file_name); - -# Create the random photo limitations -if (count($queries) == 0){ - $filters = [ - 'featured' => false, - 'orientation' => 'landscape' - ]; -} -else { - $filters = [ - 'featured' => false, - 'query' => $queries[rand(0,count($queries) - 1)], - 'orientation' => 'landscape' - ]; -} - -# Get the random photo -$img = Crew\Unsplash\Photo::random($filters); - -# Download the photo -$url = $img->download(); -$output = file_get_contents($url); - -# Write image to a file -$image_filename =getenv('HOME') . '/.rand_bg'; -$image_file = fopen($image_filename, 'w'); -fwrite($image_file, $output); -fclose($image_file); - -# Write author's name to a file -$name_file = fopen('/tmp/name_photographer', 'w'); -fwrite($name_file, $img->{'user'}['name']); -fclose($name_file);