Is there an alternative to avatars.io? - service

As http://avatars.io seems to return 404 instead of already uploaded photos, and does not allow to upload new photos, I found myself in an inconvenient situation, where I have to move to a different service provider or implement my own avatars solution.
The latter (based on my experience from nk.pl) seems to be quite time consuming, and I do not want users of my website to wait for this basic functionality, so I'd really love to hear that there is some drop-in replacement for avatars.io.
I need a service which :
allows a user to upload a photo to the cloud (preferably directly from their browser using a js library)
stores the photo, resizes it, crops it to a square shape
after the upload returns a url which can be stored in the database and subsequently used to retrieve the avatar

Related

Custom Dynamic Links in Firebase that goes to user profile

Im pretty new to Firebase, so please bear with me on this one. This problem has been stuck in my head for the past days.
I have seen some videos on Dynamic Links, but i havent seen some clear answers to what im hoping to achieve. I want to create a Dynamic Link, that allow users to share their account with their friends (through a link).
So my question is how can i manually construct a dynamic link (with User A´s uid), so when User B clicks on that link (and has the app) it will go straight into the profile of User A?
Should i create a link when a user signs up and store it under their profile in the database?
Looking forward to hearing how you guys would go about solving this problem im having.
You essentially want to create link where the link parameter (what's called the "Deep link URL" in the Firebase console) looks something like https://www.example.com/userProfile?uid=314159. (The full deep link will look different than this.)
When your app opens up this dynamic link, it will convert the incoming URL to a Dynamic Link object, and that object will have a url property that equals this link parameter. Your app will have to do the work to analyze this url and say, "Oh, this appears to be a request to view a user's profile, so I'm going to redirect to that part of my app". It won't happen automatically.
Whether you create it when the user first signs up, or when they decide to share their profile is kinda up to you. I'm generally not a fan of pre-generating deep links ahead of time, because you might realize later you want to change an aspect of these links, and that's easier to do if you don't have thousands of pre-generated DLs. Keep in mind that either way, there is a network call required to convert these longer URls into a prettier short URL.

Facebook loading multiple picture url for custom friend selector

I'm building a custom friend selector on mobile (Air, starling). I use the graph api to request invitable_friends which returns me everything i need.
My concern is about loading all these images. The basic strategy would be to loop over all the output and load all image separately.
First, i'm afraid that will be very slow and heavy for the user,
Second, i'm afraid facebook will blacklist the incoming connection if it gets too many calls.
So my question is, is there any specific strategy, as caching the images on the mobile harddrive to load them only once (and refresh once in a while)
Or does facebook another way to access all those data in a single request ?
Thanks

Best way to retrieve facebook profile images using MVC5 OWIN

I am using OWIN in mvc5 to authenticate users, but I want to show their profile pictures as well. I have searched on strackoverflow and found the following way to get it done.
This is for facebook & Google plus :
https://plus.google.com/s2/photos/profile/[USERID]?sz=100
http://graph.facebook.com/[USERID]/picture?type=square
Is this the best way to retrieve the images? Should we store images onto our server and load locally or we call these links every time someone logs in ? I need a proper approach, e.g. If we store them locally then they won't be updated if user changes their profile picture on facebook but if we load them every time from facebook then it takes some loading time to do a 302 redirect to actual image url.
If you're just trying to display the images on a website, I would just store the link your given from Facebook/Google when someone logs in to your site in a local database and use the URL as the image src on the website. Facebook and Google will be storing these images on fast CDNs, you might as well take advantage.
This will off load the image storage and the need to serve up images from your own site, reducing load and storage requirements.
Then every time a user logs into your site retrieve their profile pic urls again and store them to make sure they are up to date.

Caching Feeds from Facebook, Twitter & Instagram

I'm building a site for a non-profit festival where we'd like to have a 'media' page which brings in photos from instagram (hashtag search), updates and photos from Facebook (via festival's albums) twitter posts (by user and hashtag).
I've tried the JS widgets for Facebook and Twitter but wondered about using PHP/Codeigniter to pull the feeds and caching them somehow for better performance and more control over the look.
Would it be best to then store the feed data in a json file on the server or in a MySQL record?
I'm leaning toward a table with a record for each feed that would basically just store the feed URL, JSON, last updated time and an identifier of some sort.
Then I could write a class with the following type of methods:
get_feed($id='facebook_updates', $expiry_time=3600);
Does this seem like a reasonable way to go? or is there a better solution already existing?
I'm not quite sure how I'd work that in with the feeds that need Auth (twitter & Instagram)
bro!
First, it does seem a reasonable way to do it and I don't know any better.
But, if I had to accomplish that, I would break my problem in two:
A server side code to grab the info from the services (that I would
probably store as json so that I could use the info returned
directly) running with cronjobs from time to time.
A client side (server would work too) one to show that info with
customized style.
To work with the feeds that need auth, you'll have to create an app in each of them, authorize it to access your personal account and use it in the code. Never worked with Instagram but the others have good documentation on how to do that.
Finally, with some modification, you may be able to use this wonderful too to help you accomplish your task: http://plugins.in1.com/socialist

Hosting password protected videos for my iphone app

I am building a paid iphone application which
- shows some premium content videos to the user.
- app loads a page from my webserver in UIWebView
- but the videos are hosted at some other video hosting site.
I realize that, in order for me to be keep this app paid, I need to keep the video links protected/secure (else if the urls are leaked, no one is going to want to pay for it).
I can easily password protect the webpage (pointing to the actual video) and make the user name and password available to the iphone app to access this webpage. But when the user selects the video link, the app will load that url. If user sniffed the packets on the iphone at this time, they could get access to the url and just run it from there directly.
I dont believe mod_sec_download or mod_xsendfile can work in this scenario because the video link is external. Right?
Is Amazon S3 a possible solution?
Would appreciate any insight/solution.
Thanks!
Don't point directly to a video file. That'll make it trivial to steal. instead, point at a proxy script that can check the source of the request and verify that it's coming from a registered purchaser.
With appropriate one-time tokens, tracking of usage, etc... you can keep most people from sucking your site dry. And of course, the best practice is to embed a watermark into the video as it plays, so that even if it gets stolen, you can track it back to the first person to release it.
You might want to take a look at the OWASP Top 10 and in particular, number 8 about failure to restrict URL access. This is effectively your scenario: you have resources which need to be secured at the server level. You can't just do this from the device end, the location of resources requested by the device is easily discoverable.
So it comes down to access controls on the resources, in this case, your videos. How you do this will depend in part on your server stack. For example, IIS7 has an integrated pipeline which can apply access controls to resources of any type such as PDFs, images and videos (more on this in OWASP Top 10 for .NET developers part 8: Failure to Restrict URL Access). Alternatively, you'll need some form of application proxy which can take responsibility for the authentication then delivery of the video content.
This is really more of a webserver issue than an iPhone issue. Focus on getting the access controls right on the server then the iPhone end will be a much more straight forward process.