Skip to content

Commit

Permalink
Progress report tool now generates PROGRESS.md
Browse files Browse the repository at this point in the history
(build and run IF.Lastfm.ProgressReport to update)
Closes #28
  • Loading branch information
rikkit committed Oct 26, 2014
1 parent d0a4283 commit 28259b5
Show file tree
Hide file tree
Showing 5 changed files with 269 additions and 11 deletions.
191 changes: 191 additions & 0 deletions PROGRESS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Api Progress

These are all the Last.fm API methods currently available.

- Methods implemented by the [Inflatable Last.fm .NET SDK](https://github.com/inflatablefriends/lastfm) link to the relevant documentation page.
- Methods ~~marked with strikethrough~~ aren't currently implemented. Pull requests are welcome!
- Methods _marked with an asterisk *_ aren't listed on [the Last.fm documentation](http://www.last.fm/api), so they might not work!

This list is generated by the [ProgressReport](https://github.com/inflatablefriends/lastfm/tree/master/src/IF.Lastfm.ProgressReport) tool in the solution. Last updated on 26 October 2014 14:27
## Album

- [album.getInfo](http://www.last.fm/api/show/album.getInfo)
- [album.getShouts](http://www.last.fm/api/show/album.getShouts)
- [album.search](http://www.last.fm/api/show/album.search)
- ~~[album.addTags](http://www.last.fm/api/show/album.addTags)~~
- ~~[album.getBuylinks](http://www.last.fm/api/show/album.getBuylinks)~~
- ~~[album.getTags](http://www.last.fm/api/show/album.getTags)~~
- ~~[album.getTopTags](http://www.last.fm/api/show/album.getTopTags)~~
- ~~[album.removeTag](http://www.last.fm/api/show/album.removeTag)~~
- ~~[album.share](http://www.last.fm/api/show/album.share)~~
- _album.shout_ *

## Artist

- [artist.getInfo](http://www.last.fm/api/show/artist.getInfo)
- [artist.getShouts](http://www.last.fm/api/show/artist.getShouts)
- [artist.getSimilar](http://www.last.fm/api/show/artist.getSimilar)
- [artist.search](http://www.last.fm/api/show/artist.search)
- [artist.shout](http://www.last.fm/api/show/artist.shout)
- ~~[artist.addTags](http://www.last.fm/api/show/artist.addTags)~~
- ~~[artist.getCorrection](http://www.last.fm/api/show/artist.getCorrection)~~
- ~~[artist.getEvents](http://www.last.fm/api/show/artist.getEvents)~~
- ~~[artist.getPastEvents](http://www.last.fm/api/show/artist.getPastEvents)~~
- ~~[artist.getPodcast](http://www.last.fm/api/show/artist.getPodcast)~~
- ~~[artist.getTags](http://www.last.fm/api/show/artist.getTags)~~
- ~~[artist.getTopAlbums](http://www.last.fm/api/show/artist.getTopAlbums)~~
- ~~[artist.getTopFans](http://www.last.fm/api/show/artist.getTopFans)~~
- ~~[artist.getTopTags](http://www.last.fm/api/show/artist.getTopTags)~~
- ~~[artist.getTopTracks](http://www.last.fm/api/show/artist.getTopTracks)~~
- ~~[artist.removeTag](http://www.last.fm/api/show/artist.removeTag)~~
- ~~[artist.share](http://www.last.fm/api/show/artist.share)~~
- _artist.topAlbums_ *
- _artist.topTracks_ *

## Auth

- [auth.getMobileSession](http://www.last.fm/api/show/auth.getMobileSession)
- ~~[auth.getSession](http://www.last.fm/api/show/auth.getSession)~~
- ~~[auth.getToken](http://www.last.fm/api/show/auth.getToken)~~

## Chart

- [chart.getTopArtists](http://www.last.fm/api/show/chart.getTopArtists)
- [chart.getTopTracks](http://www.last.fm/api/show/chart.getTopTracks)
- ~~[chart.getHypedArtists](http://www.last.fm/api/show/chart.getHypedArtists)~~
- ~~[chart.getHypedTracks](http://www.last.fm/api/show/chart.getHypedTracks)~~
- ~~[chart.getLovedTracks](http://www.last.fm/api/show/chart.getLovedTracks)~~
- ~~[chart.getTopTags](http://www.last.fm/api/show/chart.getTopTags)~~

## Event

- ~~[event.attend](http://www.last.fm/api/show/event.attend)~~
- ~~[event.getAttendees](http://www.last.fm/api/show/event.getAttendees)~~
- ~~[event.getInfo](http://www.last.fm/api/show/event.getInfo)~~
- ~~[event.getShouts](http://www.last.fm/api/show/event.getShouts)~~
- ~~[event.share](http://www.last.fm/api/show/event.share)~~
- ~~[event.shout](http://www.last.fm/api/show/event.shout)~~

## Geo

- ~~[geo.getEvents](http://www.last.fm/api/show/geo.getEvents)~~
- ~~[geo.getMetroArtistChart](http://www.last.fm/api/show/geo.getMetroArtistChart)~~
- ~~[geo.getMetroHypeArtistChart](http://www.last.fm/api/show/geo.getMetroHypeArtistChart)~~
- ~~[geo.getMetroHypeTrackChart](http://www.last.fm/api/show/geo.getMetroHypeTrackChart)~~
- ~~[geo.getMetroTrackChart](http://www.last.fm/api/show/geo.getMetroTrackChart)~~
- ~~[geo.getMetroUniqueArtistChart](http://www.last.fm/api/show/geo.getMetroUniqueArtistChart)~~
- ~~[geo.getMetroUniqueTrackChart](http://www.last.fm/api/show/geo.getMetroUniqueTrackChart)~~
- ~~[geo.getMetroWeeklyChartlist](http://www.last.fm/api/show/geo.getMetroWeeklyChartlist)~~
- ~~[geo.getMetros](http://www.last.fm/api/show/geo.getMetros)~~
- ~~[geo.getTopArtists](http://www.last.fm/api/show/geo.getTopArtists)~~
- ~~[geo.getTopTracks](http://www.last.fm/api/show/geo.getTopTracks)~~

## Group

- ~~[group.getHype](http://www.last.fm/api/show/group.getHype)~~
- ~~[group.getMembers](http://www.last.fm/api/show/group.getMembers)~~
- ~~[group.getWeeklyAlbumChart](http://www.last.fm/api/show/group.getWeeklyAlbumChart)~~
- ~~[group.getWeeklyArtistChart](http://www.last.fm/api/show/group.getWeeklyArtistChart)~~
- ~~[group.getWeeklyChartList](http://www.last.fm/api/show/group.getWeeklyChartList)~~
- ~~[group.getWeeklyTrackChart](http://www.last.fm/api/show/group.getWeeklyTrackChart)~~

## Library

- ~~[library.addAlbum](http://www.last.fm/api/show/library.addAlbum)~~
- ~~[library.addArtist](http://www.last.fm/api/show/library.addArtist)~~
- ~~[library.addTrack](http://www.last.fm/api/show/library.addTrack)~~
- ~~[library.getAlbums](http://www.last.fm/api/show/library.getAlbums)~~
- ~~[library.getArtists](http://www.last.fm/api/show/library.getArtists)~~
- ~~[library.getTracks](http://www.last.fm/api/show/library.getTracks)~~
- ~~[library.removeAlbum](http://www.last.fm/api/show/library.removeAlbum)~~
- ~~[library.removeArtist](http://www.last.fm/api/show/library.removeArtist)~~
- ~~[library.removeScrobble](http://www.last.fm/api/show/library.removeScrobble)~~
- ~~[library.removeTrack](http://www.last.fm/api/show/library.removeTrack)~~

## Playlist

- ~~[playlist.addTrack](http://www.last.fm/api/show/playlist.addTrack)~~
- ~~[playlist.create](http://www.last.fm/api/show/playlist.create)~~

## Radio

- ~~[radio.getPlaylist](http://www.last.fm/api/show/radio.getPlaylist)~~
- ~~[radio.search](http://www.last.fm/api/show/radio.search)~~
- ~~[radio.tune](http://www.last.fm/api/show/radio.tune)~~

## Tag

- ~~[tag.getInfo](http://www.last.fm/api/show/tag.getInfo)~~
- ~~[tag.getSimilar](http://www.last.fm/api/show/tag.getSimilar)~~
- ~~[tag.getTopAlbums](http://www.last.fm/api/show/tag.getTopAlbums)~~
- ~~[tag.getTopArtists](http://www.last.fm/api/show/tag.getTopArtists)~~
- ~~[tag.getTopTags](http://www.last.fm/api/show/tag.getTopTags)~~
- ~~[tag.getTopTracks](http://www.last.fm/api/show/tag.getTopTracks)~~
- ~~[tag.getWeeklyArtistChart](http://www.last.fm/api/show/tag.getWeeklyArtistChart)~~
- ~~[tag.getWeeklyChartList](http://www.last.fm/api/show/tag.getWeeklyChartList)~~
- ~~[tag.search](http://www.last.fm/api/show/tag.search)~~

## Tasteometer

- ~~[tasteometer.compare](http://www.last.fm/api/show/tasteometer.compare)~~
- ~~[tasteometer.compareGroup](http://www.last.fm/api/show/tasteometer.compareGroup)~~

## Track

- [track.getInfo](http://www.last.fm/api/show/track.getInfo)
- [track.getShouts](http://www.last.fm/api/show/track.getShouts)
- [track.getSimilar](http://www.last.fm/api/show/track.getSimilar)
- [track.love](http://www.last.fm/api/show/track.love)
- [track.search](http://www.last.fm/api/show/track.search)
- [track.unlove](http://www.last.fm/api/show/track.unlove)
- ~~[track.addTags](http://www.last.fm/api/show/track.addTags)~~
- ~~[track.ban](http://www.last.fm/api/show/track.ban)~~
- ~~[track.getBuylinks](http://www.last.fm/api/show/track.getBuylinks)~~
- ~~[track.getCorrection](http://www.last.fm/api/show/track.getCorrection)~~
- ~~[track.getFingerprintMetadata](http://www.last.fm/api/show/track.getFingerprintMetadata)~~
- ~~[track.getTags](http://www.last.fm/api/show/track.getTags)~~
- ~~[track.getTopFans](http://www.last.fm/api/show/track.getTopFans)~~
- ~~[track.getTopTags](http://www.last.fm/api/show/track.getTopTags)~~
- ~~[track.removeTag](http://www.last.fm/api/show/track.removeTag)~~
- ~~[track.scrobble](http://www.last.fm/api/show/track.scrobble)~~
- ~~[track.share](http://www.last.fm/api/show/track.share)~~
- ~~[track.unban](http://www.last.fm/api/show/track.unban)~~
- ~~[track.updateNowPlaying](http://www.last.fm/api/show/track.updateNowPlaying)~~
- _track.shout_ *

## User

- [user.getInfo](http://www.last.fm/api/show/user.getInfo)
- [user.getRecentStations](http://www.last.fm/api/show/user.getRecentStations)
- [user.getRecentTracks](http://www.last.fm/api/show/user.getRecentTracks)
- [user.getShouts](http://www.last.fm/api/show/user.getShouts)
- [user.getTopAlbums](http://www.last.fm/api/show/user.getTopAlbums)
- [user.shout](http://www.last.fm/api/show/user.shout)
- ~~[user.getArtistTracks](http://www.last.fm/api/show/user.getArtistTracks)~~
- ~~[user.getBannedTracks](http://www.last.fm/api/show/user.getBannedTracks)~~
- ~~[user.getEvents](http://www.last.fm/api/show/user.getEvents)~~
- ~~[user.getFriends](http://www.last.fm/api/show/user.getFriends)~~
- ~~[user.getLovedTracks](http://www.last.fm/api/show/user.getLovedTracks)~~
- ~~[user.getNeighbours](http://www.last.fm/api/show/user.getNeighbours)~~
- ~~[user.getNewReleases](http://www.last.fm/api/show/user.getNewReleases)~~
- ~~[user.getPastEvents](http://www.last.fm/api/show/user.getPastEvents)~~
- ~~[user.getPersonalTags](http://www.last.fm/api/show/user.getPersonalTags)~~
- ~~[user.getPlaylists](http://www.last.fm/api/show/user.getPlaylists)~~
- ~~[user.getRecommendedArtists](http://www.last.fm/api/show/user.getRecommendedArtists)~~
- ~~[user.getRecommendedEvents](http://www.last.fm/api/show/user.getRecommendedEvents)~~
- ~~[user.getTopArtists](http://www.last.fm/api/show/user.getTopArtists)~~
- ~~[user.getTopTags](http://www.last.fm/api/show/user.getTopTags)~~
- ~~[user.getTopTracks](http://www.last.fm/api/show/user.getTopTracks)~~
- ~~[user.getWeeklyAlbumChart](http://www.last.fm/api/show/user.getWeeklyAlbumChart)~~
- ~~[user.getWeeklyArtistChart](http://www.last.fm/api/show/user.getWeeklyArtistChart)~~
- ~~[user.getWeeklyChartList](http://www.last.fm/api/show/user.getWeeklyChartList)~~
- ~~[user.getWeeklyTrackChart](http://www.last.fm/api/show/user.getWeeklyTrackChart)~~
- ~~[user.signUp](http://www.last.fm/api/show/user.signUp)~~
- ~~[user.terms](http://www.last.fm/api/show/user.terms)~~

## Venue

- ~~[venue.getEvents](http://www.last.fm/api/show/venue.getEvents)~~
- ~~[venue.getPastEvents](http://www.last.fm/api/show/venue.getPastEvents)~~
- ~~[venue.search](http://www.last.fm/api/show/venue.search)~~

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Some documentation is available on the [GitHub wiki](https://github.com/rikkit/l
- Provide functionality beyond mere API bindings, to spread the joy of Last.fm to developers everywhere.
- To be the very best, like no-one ever was.

## Implemented Features

Check the [progress report](https://github.com/inflatablefriends/lastfm/blob/master/PROGRESS.md) for a list of implemented methods.

## Planned Features

Everyone working with Last.fm is likely to need similar kinds of features, so it makes sense for us to work on them together. Here are a few things to look for in the future:
Expand Down
4 changes: 4 additions & 0 deletions src/IF.Lastfm.ProgressReport/IF.Lastfm.ProgressReport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="copy-report.ps1" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand All @@ -71,6 +72,9 @@
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>"%25WINDIR%25\SysNative\WindowsPowerShell\v1.0\powershell.exe" ..\..\copy-report.ps1 -outputDir '$(TargetDir)' -targetDir '$(SolutionDir)'</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
75 changes: 64 additions & 11 deletions src/IF.Lastfm.ProgressReport/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using HtmlAgilityPack;
using System.IO;
using System.Text;
using HtmlAgilityPack;
using IF.Lastfm.Core.Api.Commands;
using System;
using System.Collections.Generic;
Expand All @@ -15,6 +17,17 @@ public class Program
{
public const string API_INTRO_PAGE = "http://www.last.fm/api/intro";

private const string _progressReportIntro = @"# Api Progress
These are all the Last.fm API methods currently available.
- Methods implemented by the [Inflatable Last.fm .NET SDK](https://github.com/inflatablefriends/lastfm) link to the relevant documentation page.
- Methods ~~marked with strikethrough~~ aren't currently implemented. Pull requests are welcome!
- Methods _marked with an asterisk *_ aren't listed on [the Last.fm documentation](http://www.last.fm/api), so they might not work!
This list is generated by the [ProgressReport](https://github.com/inflatablefriends/lastfm/tree/master/src/IF.Lastfm.ProgressReport) tool in the solution. Last updated on {0}
";

public static void Main(string[] args)
{
// scrape Last.fm API documentation
Expand All @@ -27,17 +40,10 @@ public static void Main(string[] args)
// reflect on Last.fm assembly to find all implemented commands
var allImplemented = GetImplementedCommands().ToList();

foreach (var group in apiGroup)
{
var apiGroupName = group.Key;
var implemented = allImplemented.Where(m => m.StartsWith(apiGroupName.ToLowerInvariant(), StringComparison.Ordinal)).ToList();

var matches = group.Value.Intersect(implemented);
var notImplemented = group.Value.Except(implemented);
var secret = implemented.Except(group.Value);
// generate the markdown
WriteReport(apiGroup, allImplemented);

// TODO got all the information, now need to generate something!
}
// file is copied to the solution root by a post-build script.
}

#region Scrape
Expand Down Expand Up @@ -134,5 +140,52 @@ private static string GetApiMethodFromCommandType(Type type)
}

#endregion

#region Report

private static void WriteReport(Dictionary<string, IEnumerable<string>> apiGroup, List<string> allImplemented)
{
var markdownBuilder = new StringBuilder();
markdownBuilder.AppendFormat(_progressReportIntro, DateTime.UtcNow.ToString("f"));

foreach (var group in apiGroup.OrderBy(kv => kv.Key))
{
var apiGroupName = @group.Key;
var implemented =
allImplemented.Where(m => m.StartsWith(apiGroupName.ToLowerInvariant(), StringComparison.Ordinal)).ToList();

var matches = @group.Value.Intersect(implemented).ToList();
var notImplemented = @group.Value.Except(implemented).ToList();
var secret = implemented.Except(@group.Value).ToList();

markdownBuilder.AppendFormat("## {0}\n\n", apiGroupName);
foreach (var match in matches)
{
markdownBuilder.AppendFormat("- [{0}](http://www.last.fm/api/show/{0})\n", match);
}
foreach (var match in notImplemented)
{
markdownBuilder.AppendFormat("- ~~[{0}](http://www.last.fm/api/show/{0})~~\n", match);
}
foreach (var match in secret)
{
markdownBuilder.AppendFormat("- _{0}_ *\n", match);
}
markdownBuilder.AppendLine();
}

var markdown = markdownBuilder.ToString();

// write to output directory
using (var fs = new FileStream("PROGRESS.md", FileMode.Create))
{
using (var sw = new StreamWriter(fs))
{
sw.Write(markdown);
}
}
}

#endregion
}
}
6 changes: 6 additions & 0 deletions src/IF.Lastfm.ProgressReport/copy-report.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Param(
[Parameter(Mandatory=$true)][string]$outputDir,
[Parameter(Mandatory=$true)][string]$targetDir
)

Copy-Item "$($outputDir)PROGRESS.md" "$($targetDir)PROGRESS.md"

0 comments on commit 28259b5

Please sign in to comment.