Get the release date of an album last.fm api - last.fm

I need to get the release date of a song.
In last.fm API, like described on the documentation, is enough to make an HTTP request to the server and it will reply with an XML (or JSON) that contain the field "" (like is shown in the Sample Response on the website).
The problem is that if I call with the same request in the documentation the reply is identical except the field that I need.
Is possible to get this information in another way?
Example:
portion of the sample response in the website:
<album>
<name>Believe</name>
<artist>Cher</artist>
<id>2026126</id>
<mbid>61bf0388-b8a9-48f4-81d1-7eb02706dfb0</mbid>
<url>http://www.last.fm/music/Cher/Believe</url>
<releasedate>6 Apr 1999, 00:00</releasedate> //i need this
<image size="small">...</image>
<image size="medium">...</image>
<image size="large">...</image>
<listeners>47602</listeners>
<playcount>212991</playcount>
<toptags>
<tag>
<name>pop</name>
<url>http://www.last.fm/tag/pop</url>
</tag>
...
</toptags>
<tracks>
<track rank="1">
<name>Believe</name>
<duration>239</duration>
<mbid/>
<url>http://www.last.fm/music/Cher/_/Believe</url>
<streamable fulltrack="0">1</streamable>
<artist>
<name>Cher</name>
<mbid>bfcc6d75-a6a5-4bc6-8282-47aec8531818</mbid>
<url>http://www.last.fm/music/Cher</url>
</artist>
</track>
...
</tracks>
</album>
my Response
<album>
<name>Believe</name>
<artist>Cher</artist>
<mbid>63b3a8ca-26f2-4e2b-b867-647a6ec2bebd</mbid>
<url>https://www.last.fm/music/Cher/Believe</url>
<image size="small">
https://lastfm.freetls.fastly.net/i/u/34s/3b54885952161aaea4ce2965b2db1638.png
</image>
<image size="medium">
https://lastfm.freetls.fastly.net/i/u/64s/3b54885952161aaea4ce2965b2db1638.png
</image>
<image size="large">
https://lastfm.freetls.fastly.net/i/u/174s/3b54885952161aaea4ce2965b2db1638.png
</image>
<image size="extralarge">
https://lastfm.freetls.fastly.net/i/u/300x300/3b54885952161aaea4ce2965b2db1638.png
</image>
<image size="mega">
https://lastfm.freetls.fastly.net/i/u/300x300/3b54885952161aaea4ce2965b2db1638.png
</image>
<image size="">
https://lastfm.freetls.fastly.net/i/u/300x300/3b54885952161aaea4ce2965b2db1638.png
</image>
<listeners>405536</listeners>
<playcount>2644726</playcount>
<tracks>
...
<tags>...</tags>
<wiki>...</wiki>
</album>
</lfm>
The request is http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=MY_API_KEY&artist=Cher&album=Believe
The page where that informations are is: https://www.last.fm/api/show/album.getInfo
Thanks a lot!

Definitely an inconsistency in the Last.fm API documentation vs the actual response.
The only other place where such an info might be available is the artist.getTopAlbums, but the release date is not available there either.
So, to answer your question, no, it is not possible to get the release date of the album via the API. Your best bet, if you really want this piece of information, is to extract it from the html page itself via web-scraping, and to not rely on the API for this scenario.

I'm having the same issue - the release date doesn't come back. I've opted to use the MusicBrainz API to get the album details. However the issue with that is the calls will come back as 500s if too many requests are made in quick succession - the only workaround that I can find is to put a second delay on each call, which becomes annoying with a lot of albums.
Anyway, here's a sample request : http://musicbrainz.org/ws/2/release/844eb096-2b84-4c8f-9922-7f287126b39e?fmt=json
If you find a workaround for the timing issue let me know

Related

XPage Widget with extension.xml

I am just developing an XPage Widget with a manifest extension.xml.
<?xml version="1.0" encoding="UTF-8"?>
<webcontextConfiguration version="1.1">
<palleteItem title="XWidget" viewImageUrl="" url="notes://venus/xxx/Dev/Source/CC/CC_40_DEDE_SRC.NSF/streamCC.xsp?
OpenXPage&1536921419?OpenXPage=null" singletonSidebar="false"
providerId="com.ibm.notes.toolbox.provider.XPagesPalleteProvider" imageUrl="" id="1385849393" hideThumbnail="false"
contributeToSideshelfOnStartup="true" contributeTabOnStartup="false">
<preferences/>
<data/>
</palleteItem>
</webcontextConfiguration>
I have already researched the meaning of the different parts. Only the parameters of the URL "notes://venus/xxx/Dev/Source/CC/CC_40_DEDE_SRC.NSF/streamCC.xsp?OpenXPage&1536921419?OpenXPage=null" are not clear to me.
It seems to be a bug during URL generation, but the bug has no consequences.
The URL parameters are splitted into two elements:
OpenXPage
1536921419?OpenXPage=null
While the meaning of the first parameter should be clear, the second one is to prevent caching (but is useless when "hardcoded" like in bookmarks)
1536921419 is a unix timestamp to prevent caching.
GMT: Friday, 14. September 2018 10:36:59
?OpenXPage=null
Looks like a simple coding error. "Add ?OpenXPage=[value] if URL parameter OpenXPage is null or empty".

how to bind data to a Grid Layout in sapui5 xml view

I have a list of StandardListItem elements under a Grid and would like to bind them to a json file using a json model.
This is how I do the binding in my controller. I'm confident this part is correct as I'm doing it this way for a table.
var pricingModel = new JSONModel("./model/evaluation.json");
//set model(s) to current xml view
this.getView().setModel(pricingModel, "pricingModel");
This is a piece of my xml view where I'm trying to bind my data
<l:Grid class="sapUiSmallMarginTop"
id="priceEvalGridContainer" visible="false"
binding="{/PriceEstimate}">
<l:content>
<l:VerticalLayout id="priceEvalCol1" width="100%">
<StandardListItem title="NSN"
info="{NSNID}"/>
<StandardListItem title="DLA Price Estimate (DLA)"
info="{DLAPriceEstimate}"/>
<StandardListItem title="Proposed Price"
info="$20.00" />
</l:VerticalLayout>
<l:VerticalLayout id="priceEvalCol2" width="100%">
<StandardListItem title="$ Difference From DLA" info="$1.50" />
<StandardListItem title="Total Price Difference" info="$135.00" />
<StandardListItem title="PPI Price Adjusted For Inflation" info="$18.59" />
</l:VerticalLayout>
</l:content>
</l:Grid>
I have hard-coded a lot of the values as I haven't been able to properly connect the data. The only items being tested for now are info="{NSNID}" and info="{DLAPriceEstimate}"
I've seen examples on how to bind a StandardListItem within a List or a Grid with other type of objects, but haven't seen it being done together.
I tried doing the binding in the following way but it didn't work for me.
<l:Grid class="sapUiSmallMarginTop"
id="priceEvalGridContainer" visible="false"
binding="{
path: '/PriceEstimate'
}">
The app runs with no problems and there are no errors being shown, however the data does not show up in the grid. It's just blank.
this.getView().setModel(pricingModel, "pricingModel");
Since you are using named model, use:
binding="{pricingModel>/PriceEstimate}"
And if this data JSON is an array, you may have to give index in the content like:
info="{pricingModel>0/NSNID}"
else: info="{pricingModel>NSNID}" will do. (Similarly for others)
Either way, it depends on the data. So add how pricingModel looks.

WinRt :XAML Tag doesnot exist in the namespace

I am creating a project to which I want to validate textbox ,therefore use prism for that and implementing example like this below
http://msdn.microsoft.com/en-us/library/windows/apps/xx130660.aspx
All I have implemented worked fine but when I changes the code in Page's xaml than it doesn't find the classes etc. which I have implemented .
For Example
<prism:VisualStateAwarePage
xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
xmlns:vm="using:PrismExample.ViewModels"
xmlns:Behaviors="using:PrismExample.Behaviors"
x:Class="PrismExample.Views.UserInfoView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<Page.DataContext>
**<vm:UserInfoViewModel/>**
</Page.DataContext>
<TextBox x:Name="FirstNameValue" Grid.Row="2"
Text="{Binding UserInfo.FirstName, Mode=TwoWay}">
<interactivity:Interaction.Behaviors>
<!--<Behaviors:HighlightFormFieldOnErrors PropertyErrors="{Binding UserInfo.Errors[FirstName]}">-->
**<quickstartBehaviors:HighlightFormFieldOnErrors** PropertyErrors="{Binding UserInfo.Errors[FirstName]}" />
</interactivity:Interaction.Behaviors>
</prism:VisualStateAwarePage>
Now here ,the bold text gives the error that it doesnot exists in the namespace.
Can anybody help me out of this. How I can I get rid of this.
You have:
<Page.DataContext>
**<vm:UserInfoViewModel/>**
</Page.DataContext>
Should this be:
<prism:VisualStateAwarePage.DataContext>
<vm:UserInfoViewModel/>
</prism:VisualStateAwarePage.DataContext>
In your code, you reference quickstartBehaviors but you only have an XMLNS of Behaviors defined in your page. You should look where HighlightFormFieldOnErrors is defined.
Let's pretend that works. But, Noor, I am not sure how to say this. Validation on a control is different than validation in the view model. What I mean is, I think there might be a better way for your to consider. If you are interested, read this: http://blog.jerrynixon.com/2014/07/lets-code-handling-validation-in-your.html
Best of luck!

Change image dynamically in Flash Builder 4.6

In my code I have defined the following:
<s:Image id="test" x="50" y="50" width="30" height="30" click="onClick_clickHandler(event)" smooth="true" smoothingQuality="high" source="#Embed('icons/myImage_60_off.png')"/>
What I want is to be able to change the source of the image every time the user clicks on the image - similar to the way favourites work on a browser.
I have no idea how to change the source of the image from my code.
Thank you
I had a hidden datagrid with my solution, because it started off with a visible one.
The image looked like this:
<mx:Image top="153" left="10" right="10" bottom="5" source="{dgpick.selectedItem.ImageFile}" />
Every time someone clicks on the image, I would increase the selected index of the datagrid, and the labels will display the corresponding data, as they are also bound to its data.
The image can also have a link to an XML file that you can load like this:
<s:HTTPService id="Config"
url="config.xml"
result="resultHandler(event)"/>
private function resultHandler(event:ResultEvent):void
{
ImagesURL = event.result.images.ImagesURL[iCounter];
}
Every time someone clicks on the image, you can increase the counter, and so forth.
Hope this gives you some ideas.
There are 20 ways to do this.
If you need more code, add a comment, with what you need.
I finally did it!
public var image_loader:Loader; // define a new loader
image_loader = new Loader(); // create the new loader at the desired location (in my case in the initialization method of the page
image_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded); //add a listener and a function to assign to the listener
depending on where the command has to be executed
image_loader.load(new URLRequest('location of the image')); //this will load the image dynamically
function imageLoaded(event:Event):void {image_Id.source = image_loader;} //where image_Id is the id of the s:Image tag to be modified
also, I had to remove the source from the s:Image tag previously posted
The rest is just logic of the way the application needs to implement the functionality, so it's pretty much left to the developer's desires

Spring Security multiple filterChainProxy mapping/filters, custom filters Json Output

I have a part of my web application that is an RESTfull api and part a more standard web-pages.
I wish to have the REST part with some custom filters such as the EntryPoint, SuccessHandler and FailureHandler. This part is within the /rest/** mapping.
In the other hand, everything else needs to have more common filters and is mapped with /**.
The problem is to find an easy way to define the filterChainProxy with different mapping-filters.
Right now this solution doesn't work:
<!-- Normal web app -->
<http auto-config="true" use-expressions="true" authentication-manager-ref="authenticationManager">
<form-login/>
<logout/>
<intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
</http>
<!-- Configure RESTfull services -->
<http use-expressions="true" authentication-manager-ref="authenticationManager" entry-point-ref="restAuthenticationEntryPoint" >
<form-login authentication-success-handler-ref="restAuthenticationSuccessHandler" login-page="/rest/login" username-parameter="username" password-parameter="password" />
<logout logout-url="/rest/logout" />
<intercept-url pattern="/rest/**" method="GET" access="hasRole('ROLE_USER')" />
<intercept-url pattern="/rest/**" method="POST" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/rest/**" method="PUT" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/rest/**" method="DELETE" access="hasRole('ROLE_ADMIN')" />
</http>
It complains with: the univseral match being before other patterns.
Is there a way to define such a thing without resorting to define the filterChainProxy with the definition? The http version does help quite a lot to reduce the amount of configuration as I will have to manually set a UsernamePasswordAuthenticationFilter etc.
The next problem is more simple: I have to respond, after the form-login authentication with a JSON object.
So far, I have implemented a SuccessHandler (actually a version of the SimpleUrlAuthenticationSuccessHandler without the redirect part).
How do I write my JSON output?
I must have something like this:
HTTP 200 OK
with:
{"success":true,"customer {"email":"customer#email.com","session_id":"b83a41dfaca6785399f00837888886e646ff9088"}}
and a similar thing with the FailureHandler. It must be quite simple and it's surely is some very basic thing, but how do you do that? Redirecting to a custom controller is not a solution since I will have the 301 redirect status that a very simple REST client might not be able to understand.
At the very least, I wish to have only the http header and no body at all.
thanks!
If you can upgrade to Spring Security 3.1 it supports multiple chains using namespace configuration.