jinpark / common-bot

common irc bot based from willie
0 stars 0 forks source link

Filter lastfm history with time #23

Closed jinpark closed 10 years ago

jinpark commented 10 years ago

For #19

Add an option "-t" to display top 10 artists or songs over a specified interval. -t takes 3 arguments: the type of content to display (artists or tracks. maybe albums too, though that might require more work), the denomination of time the interval will be specified in(d [days], w [weeks], m [months] etc. ), and the interval itself (a numeric value). If no interval is specified, the command will use overall stats.
Usage:
.lastfm [username] -t [content type] [interval type] [interval]

Desired behavior:

.lastfm -t artists m 1
Your top 10 played artists for the past 1 month are: Brainiac (38 plays), múm (32 plays), Fluxion (23 plays), Main (19 plays), U.S. Maple (18 plays), NUMBER GIRL (16 plays), Mika Vainio (15 plays), bvdub (15 plays), Throbbing Gristle (14 plays), Sympathy Nervous (10 plays).

.lastfm haste -t tracks
Your top 10 played tracks are: MONORAL – kiri (517 plays) [.....]
jinpark commented 10 years ago

ok @Cerpin try it out

so waht it ended up being was

.lastfm --username NAME --type [artist, track, album] --interval [7day, 1month, 3month, 6month, 12month, overall]

username is optional if you have your lastfm name saved. no type option returns last played song. default interval is overall

ex

[11:31:55]  <&jin>   .lastfm --type artist --interval 3month --username bob_mcbob_2633
[11:31:56]  <common>     1. Radiohead - 105 times | 2. Arcade Fire - 21 times |

LEMME KNOW IF YOU HAVE QUESTIONS/REQUESTS @CERPIN

jinpark commented 10 years ago

@cerpin doesn't seem to care soooo closing until later