Giter Club home page Giter Club logo

flickr's People

Contributors

jaykay-design avatar jeroen-g avatar jorisnoo avatar kaishiyoku avatar sunscreem avatar synchro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flickr's Issues

A question about accessing photos

Hey,

Thanks again for sharing this package. Can I get a quick sanity check on my own code?

This is how I'm fetching (and popping into a collection) a users recent photos:

 $flickrRequest = Flickr::request(
                'flickr.photos.getRecent',
                ['user_id' => config('site.flickrUserId')]
            );

  return collect($flickrRequest->photos['photo']);

Is that how you intended the package to be used?

If so I'll maybe add a PR for an example to the readme?

Upgrade to Guzzle 7

Hello, I'm using your package for a Laravel-based project and recently a new major version of Laravel has been released which uses Guzzle 7. Would it be possible to upgrade your package to use Guzzle 7? I will take a look if I can make a pull request for you.

Update: Pull request: #11

Unresolvable Dependency error in Laravel Jetstream with Livewire

Having followed the instructions in your documentation I am now getting a 500 error in Laravel Livewire whilst using the package in a Livewire Component.
Error: [previous exception] [object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Unresolvable dependency resolving [Parameter #0 [ <required> string $apiKey ]] in class JeroenG\\Flickr\\Api at /Users/kay/Work/Repos/Personal/site/vendor/laravel/framework/src/Illuminate/Container/Container.php:1053)

Component:
`class Liveside extends Component
{
public $images;

public function mount(Flickr $flickr)
{
    $flickr_arguments = [
      'user_id' => '68669878@N00',
      'extras' => 'url_o',
    ];
    $this->images = $flickr->request('flickr.people.getPhotos', $flickr_arguments);
}
public function render()
{
    return view('livewire.liveside');
}

}`

I have added the serviceprovider in app.php, as well as the facade. I have also added the array entry into config/services.php

Any suggestions?

it have stopped working for some reason

Hi,
Ive been using this package for some time now.. and it was working just fine.. today i did php artisan cache:clear and the api stopped working.

ive dd'ed the result and it says:

Response {#601 ▼
  #contents: array:3 [▼
    "stat" => "fail"
    "code" => 100
    "message" => "Invalid API Key (Key has invalid format)"
  ]
}

but i have checked the flickr app garden and confirmed the api keys i have in my settings.
here is my controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;

class WelcomeController extends Controller
{
    public function index(Request $request)
    {
        $flickr = new \JeroenG\Flickr\Flickr(new \JeroenG\Flickr\Api(env('FLICKR_KEY', ''), 'php_serial'));
        $perPage = 6;
        if ($request->has('page')) {
            $page = $request->has('page');
        } else {
            $page = 1;
        }
        $results = $flickr->listSets([
            'user_id' => env('FLICKR_USER'),
            'page' => $page,
            'per_page' => $perPage
        ]);
        dd($results);
        $albums = $results->photosets['photoset'];

        $data['metadata'] = [
            'stat' => $results->stat,
            'page' => $results->photosets['page'],
            'pages' => $results->photosets['pages'],
            'per_page' => $results->photosets['perpage'],
            'total' => $results->photosets['total'],
        ];
        $data['albums'] = $albums;
        return view('welcome')
         ->with('data', $data);
    }
}

any suggestions? :)

L5.5 compatible?

I'm not sure if I'm misusing this or if there is an incompatibility with Laravel 5.5?

I've instantiated your class with a correct api key. I then call ->photoInfo() with a valid flickr photo ID and my API secret (the photo is mine).

What seems to happen is I should get a JeroenG\Flickr\Response object back, but in fact the constructor of that class is exploding because it cannot unserialise what comes back from $guzzleResponse->getBody()->getContents() (Which I think is effectively a chunk of XML in a string?)

The exact error is

ErrorException (E_NOTICE)
unserialize(): Error at offset 0 of 2892 bytes

I'd really like to understand what's going wrong here as I'm keen to upgrade an old L4 site I have which uses the other flickr package, which is not compatible with L5...

can not make it to work.

Hi,
i was following an article regarding flickr recent pictures for laravel and came across this package.. im trying to use it but keep getting different errors.
im getting:
FatalErrorException in HomeController.php line 13: Class 'App\Http\Controllers\JeroenG\Flickr\Flickr' not found

Here is my HomeController.php

<?php

namespace App\Http\Controllers;
use Backpack\MenuCRUD\app\Models\MenuItem;
use Illuminate\Http\Request;
use App\Http\Requests;

class HomeController extends Controller
{
     public function __construct()
    {
        $flickr = new JeroenG\Flickr\Flickr(new JeroenG\Flickr\Api($key));
        $echoTest = $flickr->echoThis('helloworld');
    }
     public function index()
    {
        $this->data['menu_items'] = MenuItem::getTree();
        return view('welcome', $this->data);
    }
}

ive also tried adding use JeroenG\Flickr; but its the same.. is there any sample available?

Caching the application config breaks the package

Thanks a lot for your work!

I'm currently running into an issue when calling php artisan config:cache: This makes calls to env() return null. However, in the FlickrServiceProvider, the API key is accessed through env('FLICKR_KEY').

As as solution, the package could eg. either publish its own config file to the config folder, or possibly require setting the FLICKR_KEY in the config/services.php file?

For example, adding

'flickr' => [
        'key' => env('FLICKR_KEY'),
],

to config/services.php and then accessing the key with config('services.flickr.key') in the FlickrServiceProvider.

Let me know if you'd like me to create a pull request. ✌️

Uncaught TypeError

Getting this error when I try to run the echo test

PHP Fatal error:  Uncaught TypeError: Typed property JeroenG\Flickr\Response::$contents must be array, bool used in /home/art/vendor/jeroen-g/flickr/src/Response.php:13
Stack trace:
#0 /home/art/vendor/jeroen-g/flickr/src/Api.php(38): JeroenG\Flickr\Response->__construct(Object(GuzzleHttp\Psr7\Response))
#1 /home/art/vendor/jeroen-g/flickr/src/Flickr.php(16): JeroenG\Flickr\Api->request('flickr.test.ech...', Array)
#2 /home/art/vendor/jeroen-g/flickr/src/Flickr.php(24): JeroenG\Flickr\Flickr->request('flickr.test.ech...', Array)
#3 /home/ar/test.php(11): JeroenG\Flickr\Flickr->echoThis('helloworld')
#4 {main}
  thrown in /home/art/vendor/jeroen-g/flickr/src/Response.php on line 13

I've just followed the README. I've added my $key as a string.

Have I missed something obvious?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.