I want to display what Im currently listening to on my personal website - deezer

I dont want to have to sign into deezer everyday, I want my account to automatically display what song Im listening to on my website whenever I play anything.
What do I have to do to set this up?
I had a look at the oauth api but its not very clear how to utilize it for this kind of permanent connection.

You can use the REST API and the user/history endpoint (http://developers.deezer.com/api/user/history). What you can do is to get the access_token from the API explorer if you want (http://developers.deezer.com/api/explorer?url=user/me/history) et use it to get all the informations about your listening history with a request. Just be sure not to make available or visible your access_token.

Related

How do I subscribe my App to a webhook that continues to work even if I leave my company?

I'm trying to set up a web hook for a page that the company I work for has set up. Basically we want to embed the latest post from our Facebook page on our website, but we want full control over the look of it so I was thinking we could just use a web hook to get notified each time a new post gets made and then just store that post text in our web server DB and display that.
I'm trying to follow the steps outlined here: https://developers.facebook.com/docs/pages/realtime/
It looks like the only way to do this is to get an "App Token", and from what I understand the only way to get an "App Token" is it get a "User Token" and then make it a long term one so it never expires. I can't get that part working at all as the Graph API doesn't even let me request permissions for pages_manage_metadata, but that's another story.
My question is, if I can get this working and then down the road I leave my company and disconnect my Facebook account, will the web hook suddenly cease to function? Is there any way to do this without a token that might expire down the road? We already have a Facebook "Business" account and the Page is managed by that Business account, but it seems like I can't do anything without first using my personal FB login.

How can I allow users with their own slack account/company login to their slack account in my app

Everything I have read (e.g. https://api.slack.com/docs/oauth) makes it seem as though I can only build an app that integrates with a Slack team I manage. E.g. I have to create my Slack Client ID .. etc ... and then I can oAuth users for my team.
What I want to do is allow my app's users to login to my app using their Slack login (for their Slack team I do not control or have access to.) I don't want to force my users to generate a Client ID to use my app. I want them to login the same way Google Login or Facebook Login works.
The closest thing I have found is a "login with slack" HTML button, but I'd like to do it in iOS using Swift.
Is that possible?
Sadly, that's not possible. For google or facebook, the way authentication works is that they provide you a mobile API which handles the communication between your app and their web service. So you task is simply adopt that API, make simple function call and retrieve information for user from the API. For example, the facebook button is provided by the API.
However from a look at slack site, they only have RESTful API documented. So in this case, you have to handle the passing and storing of parameters by yourself, and send HTTP request manually. You can have a look at Alamofire framework, which is the best choice for making HTTP request. Basically, you have to send needed parameter with the specific url though HTTP request to perform a log in action, and you have to parse the respond data and then see if the login is successful or not, etc
Thanks to some help from friends it looks like the answer is yes.
You must first make sure you "Distribute App"
Then set up the permissions you require and "install app" (which is a bit not "smart" since you can accidentally add conflicting permissions and get an error when trying to install).
Once that is done you will get an Auth Token and can make requests for any user to login using oAuth.
You can also trigger a sign in request like so:
https://slack.com/oauth/authorize?client_id=[client id]&scope=identity.basic
Edit: For future Googlers, Slack now also provides a specific documentation page for this type of OAuth grant/login: Sign in with Slack

Using facebook with my robot

I develop a robot which is connected to the user Facebook profile. If the user receives a message, the robot tells the user to check his inbox (or it can even read the message aloud).
For that, I want to create a website where my users can register, and where they can connect their accounts with Facebook profiles. The website communicates with Facebook to receive any new information. And the robot connects to the user page on the website to get that information.
My question - is it possible to make it that way? Does the API rules allow it?
EDIT: Especially, I want to know if API rules allow it.
You could make use of the Realtime Update API (https://developers.facebook.com/docs/graph-api/real-time-updates).
Therefore, you need to setup an endpoint (service) with handles the push notification from the Facebook platform.
Once you did that, you can "listen" to the inbox connection of the user object. FB will tell you if something changed, but not what exactly has changed. So you need to implement an active pull of /{user_id}/inbox and compare the actual result to a cached past result.
Be sure to gather the "read_mailbox" permission with your app.

Is there a way to track if a user checks in from an application?

I am writing an mobile website that I want users to check in at the current physical location and for the website to get verification of this being done. Is it possible?
Graph API Page has a connection called checkins which you can send an Http post to to check the user in at that location. It requires permissions of user_checkins and I think publish_stream.

Twitter REST change "from API" to something meaningful

When using simple request to post to Twitter the messages are signed with "sent from API". Is there a way to change that to the actual name of your application? Is it another post parameter or something else?
This is covered in the Twitter API FAQ
If you would like tweets from your application to recieve a source parameter, please register an application and implement OAuth authentication. We will automatically include your application as the source for any tweets sent from your application.
If you are writing a desktop Twitter client and you want your application's name to show up instead of "From API", you have to use OAUth.
If you want to use OAuth in your desktop Twitter application, you have to go through Twitter's PIN workflow (i.e., sending the user to the Twitter website to authenticate).
The confirmation step is part of the reason Twitter is using OAuth. There's no getting around it.
There are several libraries out there that implement OAuth for Twitter so you're not reinventing the wheel.
If you want example on how to use OAuth and Twitter I have it in my blog
"If you are writing a desktop Twitter client and you want your application's name to show up instead of "From API", you have to use OAUth.
If you want to use OAuth in your desktop Twitter application, you have to go through Twitter's PIN workflow (i.e., sending the user to the Twitter website to authenticate)."
Hold on a moment, how do Twitter clients manage to put their client name in the "via" without you logging in somewhere and copying a PIN back to the application.
I just want a command line client that updates my status and prints "via MyApp". Am I missing something here?
(I might be, I've only started trying to figure this out yesterday)
In fact if the user isn't authenticated, I don't want to get them to login elsewhere and copy/paste a PIN, I want them to type their user/pass into my application. Like what happens with all the twitter clients I've seen...