Retrieve cover artwork using Spotify API

June 17th 2014: Today Spotify released a new Web API. It is now easy to retrieve cover artwork, as all endpoints includes an array of images for every item. Search example: curl -X GET “https://api.spotify.com/v1/search?q=tania%20bowra&type=artist” { “artists” : { … “items” : [ { … “images” : [ { “height” : 640, “url” : “https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718”, … Read more

C# how to use WM_GETTEXT / GetWindowText API / Window Title

public class GetTextTestClass{ [System.Runtime.InteropServices.DllImport(“user32.dll”, EntryPoint = “SendMessage”, CharSet = System.Runtime.InteropServices.CharSet.Auto)] public static extern bool SendMessage(IntPtr hWnd, uint Msg, int wParam, StringBuilder lParam); [System.Runtime.InteropServices.DllImport(“user32.dll”, SetLastError = true)] public static extern IntPtr SendMessage(int hWnd, int Msg, int wparam, int lparam); const int WM_GETTEXT = 0x000D; const int WM_GETTEXTLENGTH = 0x000E; public string GetControlText(IntPtr hWnd){ // Get the … Read more

Intercept the same API call multiple times in Cypress

Updated for Cypress v7.0.0 Released 04/05/2021 The change-log shows from this release the intercepts are now called in reverse order Response handlers (supplied via event handlers or via req.continue(cb)) supplied to cy.intercept() will be called in reverse order until res.send is called or until there are no more response handlers. Also illustrated in this diagram … Read more

image compression by size – iPhone SDK

Heres some example code that will attempt to compress an image for you so that it doesn’t exceed either a max compression or maximum file size CGFloat compression = 0.9f; CGFloat maxCompression = 0.1f; int maxFileSize = 250*1024; NSData *imageData = UIImageJPEGRepresentation(yourImage, compression); while ([imageData length] > maxFileSize && compression > maxCompression) { compression -= … Read more

How do I restrict JSON access?

I think you might be misunderstanding the part where the JSON request is initiated from the user’s browser rather than from your own server. The static HTML page is delivered to the user’s browser, then it turns around and executes the Javascript code on the page. This code opens a new connection back to your … Read more

Using VBA and VBA-JSON to access JSON data from WordPress API

The JsonConverter is returning a collection of VBA.Collections Scripting.Dictionaries, and Values. In order to understand the output you will have to test the TypeName of all the returned values. The real question is “How to navigate through a json object (or any unknown object for that matter) and access the values within. Immediate Window Using … Read more