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

Add logos #2422

Merged
merged 1 commit into from
Mar 11, 2019
Merged

Add logos #2422

merged 1 commit into from
Mar 11, 2019

Conversation

bhousel
Copy link
Member

@bhousel bhousel commented Mar 11, 2019

This PR adds the ability to fetch logos for all the Wikidata-tagged brands..
see #2116

  • npm run logos to run it
  • stores api secrets in config/secrets.json (this file is .gitignore'd)
  • uses brand:wikidata tag to lookup the following properties from Wikidata:
    • P154 - Brand logo from wikicommons. This works, but unfortunately the logos are often not square enough to make them suitable for what I want. But we can fetch them anyway.
    • P2002 - Twitter username -> then we use the Twitter API to fetch a square logo for that brand
    • P2003 - Facebook username -> construct Facebook Graph API url to fetch square logo
    • P2013 - Instagram username, -> (It's actually same Graph API as Facebook now, so we just save it as facebook)
  • The fetched logos are stored in a "logos": {} object on each brand entry.

This is kind of great too because: the way to add more logos is to just update Wikidata with the brand social media account, and run the script again. We are making Wikidata better!

I'd really like to merge this and make the logos available in iD, so that the users see them as they are assigning a brand preset.

Would love to hear people's thoughts!

@Adamant36
Copy link
Collaborator

Sounds awesome. I've been going through Wikidata entries to add things when I can. I'll try to prioritize it more now that there's a good reason to.

@bhousel
Copy link
Member Author

bhousel commented Mar 11, 2019

Sounds awesome. I've been going through Wikidata entries to add things when I can. I'll try to prioritize it more now that there's a good reason to.

Great! Probably the simplest thing that anybody can do right now to make a big difference is to add Twitter or Facebook usernames to Wikidata pages. This will let us display nice small logo images for each brand.

Applebees

@Adamant36
Copy link
Collaborator

Will do. It might be worth adding a sentence about it in the contributing file if its not in there already. There could almost be a unique section just for how to do things in Wikipedia/Wikidata related to companies at this point. In general, id like to see contributors here improving data there when there's opportunities.

@bhousel
Copy link
Member Author

bhousel commented Mar 11, 2019

I merged this, but without the logos, only the fetching script.
This was because the logo fetch introduced a lot of conflicts with the countryCode work done over the weekend, so it's easier to just push another change with logos soon.

@bhousel
Copy link
Member Author

bhousel commented Mar 12, 2019

It might be worth adding a sentence about it in the contributing file if its not in there already. There could almost be a unique section just for how to do things in Wikipedia/Wikidata related to companies at this point. In general, id like to see contributors here improving data there when there's opportunities.

I added a section on editing Wikidata to our contributing guide:
https://github.com/osmlab/name-suggestion-index/blob/master/CONTRIBUTING.md#memo--edit-wikidata

It's a short section but it gives people some actionable things that they can do to help and it includes the above screen capture of me adding a Twitter username. I'll also talk it up in Slack!

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

Successfully merging this pull request may close these issues.

None yet

2 participants