What's new in SMAPI 5.5? - sonos

Sonos 5.5 beta seems to have changed SMAPI somehow. Spotify for example seems to know the local time of the client, as it changes its response to getMetadata("root") depending on it, but as both the Spotify uris are https I can't sniff them to see. Anyone know what has changed?

This can be done today by looking at the Client's IP address to determine their geographic location. By refreshing the catalog (via getLastUpdate) at a regular interval you are able to update the root browse as you see in Spotify, Google and Songza to provide time specific playlists or radio.

Related

Google API blocked my app ip address and returns CAPTCHA

My app uses Google API and it worked well for a long time but recently Google blocked the IP address of my server for about an hour and every response to the API was as follows: Our systems have detected unusual traffic from your computer network. This page checks to see if it's really you sending the requests, and not a robot... - they attached CAPTCHA form field as html.
My app is also an API so CAPTCHA can not be done because it is in json format (HTML in json cannot be rendered).
Only app users sends requests so I have a little control over it. Of course, I limit the number of requests per user, but it was not the case. Limits at google console are also fine.
I wonder how can I prevent this happening in the future? Is there any way I can ask them directly? Have you experienced this?

How do you detect changes in a user's Spotify playlist?

Scenario: Spotify user on the native desktop application is adding and removing songs from the currently playing playlist.
I'm curious if it's possible for me to detect when any addition/removal happens? Basically need a trigger to tell me the playlist has changed without having to continuously poll Spotify's API to see if anything changed. Looking for a solution that could be used either via the Spotify API or something hack-ish using spotilocal or listening on Spotify's 4070 port.
Looking for a solution that could be used either via the Spotify API
or something hack-ish using spotilocal or listening on Spotify's 4070
port.
I wouldn't recommend this approach since the mentioned APIs may change without notice. It's not publicly supported so there's no commitment from Spotify to avoid breaking changes. It also requires the user to have the Spotify desktop application installed.
As you've noticed, since there's currently no way to subscribe to changes in a playlist, e.g. by a Websocket or HTTP PubSub interface like PubSubHubbub, your application would be forced to poll for changes. If you go down this path, I strongly recommend that you make use of the ETags and snapshot_id provided in the Playlist response.
Declaring how ETags are implemented in the Web API deserves a longer response and should be on the developer site. There's however a useful Working With Playlists guide on there that explains snapshots and some other things related to playlists.
It's also worth mentioning that all applications are rate limited, so I urge anyone polling to be aware of this and poll less rather than more. Obviously only poll when the application is actively used by the user, and only poll the playlist if it's actively viewed. You know you're being rate limited if you retrieve a 429 Too Many Requests response.

Soundcloud API Download

I am asking this here because Soundcloud does not have support. I going to build a website that people can purchase audio files from using Soundcloud to download the files (and stream before buy). I want to be able to access the download file link in the Soundcloud API without the download link being enabled and showing on the Soundcloud UI. I can't seem to find this info in the Soundcloud API docs. I am going to have a Paypal redirect after the payment to the download link. I know this is a weird way of doing this but I have certain criteria I have to meet. I would host the audio files on my server but they are huge. Anyone have experience with this or can help?
im not sure its possible to do what you want. (very easily at least)
there would be no way for the purchaser to access the 'download' track on soundcloud directly unless downloads are specifically enabled for that track.
really the only way to not host the files and still be able to provide the download would be to use the api to download or proxy the track from soundcloud to your server, using your credentials (because you always have access to your own tracks, download or stream). mind you this would use 2x the bandwidth usage (the server getting the track from soundcloud, and the client downloading the track), and storage space would only be impacked on a temporary bases. but. this is a pretty hacky way and not really a good/proper solution.
you can:
-compress/re-encode the audio as to not use as much disk space
-pay for more storage space at your web host, its usually pretty cheap thse days.
So you want to charge on something free? Well, I think all the downloader out there are middleware where they stream the track from soundcloud and response to client as attachment upon request, one of many examples is http://wittysound.com. Cheapest way to get thing done is providing direct link to soundcloud server like what http://soundflush.com does

Unable to Share URLs to Google+

This issue began last week. Prior to that, I was not having any problems, and I am not aware of any changes to my site or platform.
Now, when I want to share a new blog or article to Google+, it fails. Typically I would use the embedded +1 buttons on a specific post and use the expanded box to create my post. The box comes up, but instead of a nice title and image, it now uses the URL only for the page, and sometimes adds extra characters to the end of the URL. If I take the URL from the address bar and try to compose a new update directly on Google+, I get the same issue. If I enter the URL into the Link field on a status update, it usually comes back "could not load website."
Here's a sample
You'll find Google+ sharing buttons above and below the article. Sharing to every other network works as expected.
My site is a Drupal site that has been operating for 10 months. I am a Drupal developer, but have never encountered an issue like this.
It appears that requests from the Googler crawler are being rejected by your server. I tried testing the microdata with the structured data testing tool and it runs into problems connecting to your site. Other sites work fine.
If you have access to your site's Apache access logs, I would check those for problems coming to that URL. You can narrow your search down by looking for the user agent of the crawler: Google (+https://developers.google.com/+/web/snippet/)
My guess is that something changed in your server's configuration that is the cause. Start with the logs and see what's there.

From web server, how I can get the exact GPS location of an iPhone?

I want to run my code on web server which will track an iPhone's physical location (using mobile number of card inside iPhone).
How can I do that? Is coreLocation the API that gives that facility?
Your app will have to use CoreLocation to push requests to your web server with the location. The web server cannot pull the location. I do not think you can access the phone number, but you can get the Device ID.
You can get the phone's location in the browser using javascript, please see the answer at question 10567617 .
If you have the location in the browser, you could send it to your server with ajax or any traditional technique.
If you mean, through a regular web request across HTTP, you can't -- that information isn't transmitted for good reasons. However, if you were to create an App that connected to your server's app, then yes, you could simply send the update as a packet to the server as you then have unlimited access to your phones details.