Query a user's "Now Playing" in iTunes? - itunes

I am trying to create an application similar to the last.fm scrobbler. but geared specifically to a certain artist. I'd like to be able to call the album the user is currently playing in tunes and based on the first 10 numbers of the album (should be a date i.e. "1999-05-10") queue up either a website or specific information regarding that date. If anyone can even begin to help me with this it would be greatly appreciated. I signed up with Apple's SDK but haven't been able to get a really clear answer on this.
I know it all starts with something like this:
var iTunesApp = WScript.CreateObject("iTunes.Application");
iTunes.App.CurrentTrack ( [out, retval] IITTrack ** iTrack )
but don't feel like I'm getting anywhere. Again any help would be greatly appreciated.

To get the album containing the current track, use the CurrentTrack.Album property of the iTunes.Application object:
var iTunes = WScript.CreateObject("iTunes.Application")
var album = iTunes.CurrentTrack.Album;
var date = album.substr(0, 10);
...
Tip: A great way to learn the available properties and methods of the iTunes COM object is to use some ActiveX/COM/OLE object browser, e.g. Visual Studio's Object Browser, to explore the iTunes type library (contained in the iTunes.exe file).

Related

Possible to retrieve name/artist of a song from radio station website?

I am trying to create a Shazam like service that works over the phone,
I was able to use Inspect Element to dig around and find an API call for WRIT FM.
I am trying to do the same for WKLH FM but I have not been able to find any references to any code that points to the currently playing song metadata.
The now playing page is here: http://player.listenlive.co/41851
It doesn't come up when doing View Page Source either,
Is there any tool I could use to pinpoint where the metadata is coming from? I need to be able to extract text in real time using a custom-made API so I can use that in my application (Asterisk PBX),
On the song history page, there IS some of this information available but it doesn't seem like it's offered in any predictable way which could be parsed: http://player.listenlive.co/41851/en/songhistory
Thanks!

GPS coordinates to display google street view panorama

I looked at the documentation and many other questions but I couldn't find something similar to what I am looking for. I want a query url where I give in a gps coordinate and it displays the google street view panorama, or some kind of call that when I give it a GPS coordinate it gives me the "Panoid".
I dont have the panoid, or am I trying to extract it from a URL, I want to create a call that return the panoid.
I found a way that I actually wasnt looking for since Im writing my program in C++. But it seems I will do it in Javascript, and pass it to my C++ program.
In the Street View Api Documentation there is this example:
https://developers.google.com/maps/documentation/javascript/examples/streetview-service
In this example there are a few lines that are important to answering this question:
var markerPanoID = data.location.pano;
// Set the Pano to use the passed panoID.
panorama.setPano(markerPanoID);
I could just grab the data.location.pano value from there, then use it as however I may like. I hope this is not a final answer, I really wish if there is another way where I dont have to create a webservice.
What about this (via Google Maps Street View API)
https://maps.googleapis.com/maps/api/streetview?
size=10000x10000
&location=46.414382,10.013988
&heading=151.78
&pitch=0

How can i add some score stored in a variable to a SQL database from a SWF? - AS3

I have a game in SWF with AS3 that scores points and stores it on a variable called "Puntos". Here's how I'm doing it:
stop();
var puntos:int = new int();
add_puntos.addEventListener(MouseEvent.CLICK, agregar);
function agregar(event:MouseEvent):void
{
puntos=puntos+3;
puntos_txt.text=String(puntos);
trace(puntos);
}
Now, i have to take the result of the variable "puntos" and add it to the absolute score of the player on a SQL Database. ¿How can i do it? :(
UPDATE: Thanks Andrey. Effectively, it's not for mobile. I'm going to try it :)
You need backend knowledge in order to save those scores (or if you are working on a mobile - at least SQL knowledge).
The client part is easy - sending a simple POST request to the server, where all the magic happens. You can see the examples here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#includeExamplesSummary
If you are working on a mobile - things get harder, and you would need go search Google instead :)
Edit: Having in mind you are using mobile device, this is for you: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html

Retrieving and viewing google docs using gdata in objective-c

I've been trying to find an answer for this for a while and I have not come across something that explains whether it is possible or not:
I have a bunch of documents in Google Docs and I'm retrieving the list of them using gdata library. I have tried a bunch of different ways to display/open just a single one when I select one from the list but I have not been able to find what kind of request to do or url to send with the request.
The files are public and the share settings are set to public but they won't show up.
Can anyone help me out figure out how to open a Google Docs document (any file format) either in an UIWebView or in the native app?
EDIT Ok, I think there was a bit of confusion as to this question. I have a list of documents from a user's feed in which I store the resourceID of the documents in my database. These documents are public and therefore should be allowed to be opened and viewed by others. Say another user comes in and wants to view documents from another person. I call the resourceID into the viewer url and it still says it needs authorization. I figured, since the document is public, a user that has not logged in (therefore no auth token) should be able to view the document still. Just like google docs works?
The DocsSampleWindowController included with the Objective-C library includes a method that shows how to open a document using its HTML link:
- (IBAction)viewSelectedDocClicked:(id)sender {
NSURL *docURL = [[[self selectedDoc] HTMLLink] URL];
if (docURL) {
[[NSWorkspace sharedWorkspace] openURL:docURL];
}
}
I have no idea about Objective-C but I can tell you in general terms..
Just send an authenticated request at the below uri:
Be sure to replace YourDocument'sResourceID with the resource ID of the document that you want to read..
https://docs.google.com/feeds/download/documents/export/Export?id=**YourDocument'sResourceID**&exportFormat=txt&format=txt
you can also play with the variable format in the above uri.. txt gives you the simple text and no styles..

Apple Appstore name search via the API?

Is it possible to do a search for apps by title via the API? For example, the equivalent of "Return a list of apps (if any) with the word 'dog' in the title".
I've seen two access points that come close, but don't seem to offer this:
The RSS feed; it lists apps, but apparently only groupings like, "top 100..."
The query interface; but it doesn't seem to query over the app media type. (?)
I found the answer. Although not explicitly documented, it's possible to search by app name.
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
You're right, it wasn't very clear on that iTunes page at all. The parameter entity=software is the key. For example, here's a search for my app, TypeLink:
http://itunes.apple.com/search?entity=software&term=typelink&callback=myCallbackFunction
If you're wondering what the callback is for, here's some more info on the JSONP format it uses:
http://en.wikipedia.org/wiki/JSONP
For any future person who wants to link to the App Store keyword search result page directly from a web link - this format works as of April 2013:
http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&submit=media&term=KEYWORD%20GOES%20HERE
Was a PITA to figure out but finally got the syntax right... Needed this because a client has apps made by multiple developers so I couldn't just use the suggested Appstore.com/DeveloperName link to return all their apps.
Thanks all for sharing wisdom. Hope this helps someone.