Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find the information for the attribution #100

Open
RoqueCampos opened this issue Aug 3, 2019 · 2 comments
Open

How to find the information for the attribution #100

RoqueCampos opened this issue Aug 3, 2019 · 2 comments

Comments

@RoqueCampos
Copy link

Hi!

I'm not sure if I'm missing something, but I'm not able to find the information of the photographer for the attribution.

WHen getting a random photo, I call photo->download() and with that I get a download link. Thats fine. When calling photo->photographer(), the only information insider is the username.

I used the username to retrieve the User object, but again, inside there is not information for the attribution (Firstname, Lastname).

What I'm doing wrong?

Thanks.

@lukechesser
Copy link
Member

@RoqueCampos when I fetch the JSON from the API, it has the full photographer details available on the random endpoint:

{
  "id": "xNDFrCge8c4",
  "created_at": "2019-07-11T15:58:56-04:00",
  "updated_at": "2019-07-28T01:09:06-04:00",
  "width": 2829,
  "height": 3536,
  "color": "#252B2F",
  "description": null,
  "alt_description": "waver waves during daytime",
  "urls": {
    "raw": "https://images.unsplash.com/photo-1562874724-b33411b38141?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjIwMzJ9",
    "full": "https://images.unsplash.com/photo-1562874724-b33411b38141?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjIwMzJ9",
    "regular": "https://images.unsplash.com/photo-1562874724-b33411b38141?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjIwMzJ9",
    "small": "https://images.unsplash.com/photo-1562874724-b33411b38141?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjIwMzJ9",
    "thumb": "https://images.unsplash.com/photo-1562874724-b33411b38141?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjIwMzJ9"
  },
  "links": {
    "self": "https://api.unsplash.com/photos/xNDFrCge8c4",
    "html": "https://unsplash.com/photos/xNDFrCge8c4",
    "download": "https://unsplash.com/photos/xNDFrCge8c4/download",
    "download_location": "https://api.unsplash.com/photos/xNDFrCge8c4/download"
  },
  "user": {
    "id": "Vs5z87iQYAY",
    "updated_at": "2019-08-04T11:15:34-04:00",
    "username": "yuli_superson",
    "name": "Yuliya Kosolapova", <===============================================
    "first_name": "Yuliya",
    "last_name": "Kosolapova",
    "twitter_username": null,
    "portfolio_url": "https://www.instagram.com/yuli_superson/",
    "bio": "Follow me on facebook.com/trankvillina",
    "location": "Russia, Moscow",
    "links": {
      "self": "https://api.unsplash.com/users/yuli_superson",
      "html": "https://unsplash.com/@yuli_superson",
      "photos": "https://api.unsplash.com/users/yuli_superson/photos",
      "likes": "https://api.unsplash.com/users/yuli_superson/likes",
      "portfolio": "https://api.unsplash.com/users/yuli_superson/portfolio",
      "following": "https://api.unsplash.com/users/yuli_superson/following",
      "followers": "https://api.unsplash.com/users/yuli_superson/followers"
    },
    "profile_image": {
      "small": "https://images.unsplash.com/profile-1542573282965-bd0ef4147e78?ixlib=rb-1.2.1&q=80&fm=jpg&crop=faces&cs=tinysrgb&fit=crop&h=32&w=32",
      "medium": "https://images.unsplash.com/profile-1542573282965-bd0ef4147e78?ixlib=rb-1.2.1&q=80&fm=jpg&crop=faces&cs=tinysrgb&fit=crop&h=64&w=64",
      "large": "https://images.unsplash.com/profile-1542573282965-bd0ef4147e78?ixlib=rb-1.2.1&q=80&fm=jpg&crop=faces&cs=tinysrgb&fit=crop&h=128&w=128"
    },
    "instagram_username": "yuli_superson",
    "total_collections": 15,
    "total_likes": 660,
    "total_photos": 282,
  },
  ...
}

@lukechesser
Copy link
Member

@RoqueCampos does #102 change anything/help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants