Tag badges with links to tag edit history

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

--site name as per query 516017 for SEDE URLs
DECLARE @siteinit VARCHAR(100), @site VARCHAR(100)
SET @siteinit=REPLACE(LOWER( (SELECT DB_NAME() AS [Current Database]) ),'StackExchange.','')
SET @site = REPLACE(REPLACE(REPLACE( --REPLACE(
CASE
  WHEN @siteinit NOT LIKE '%.Meta' THEN @siteinit
  ELSE 'meta.'+REPLACE(@siteinit,'.Meta','')
  END
  ,'audio','avp') ,'stackoverflow.br','stackoverflow.pt') ,'stackoverflow.','')
  --,'meta.','')+'me' -- Some meta sites require this

-- BadgeClass: Badge class "1 for gold, 2 for silver, 3 for bronze"

SELECT 
  UserId AS [User Link],
  Name,
  Date,
  'http://data.stackexchange.com/'+@site
    +'/query/893914?UserId='+CAST(UserId AS varchar)
    +'&tag=%27'+CAST(Name AS varchar)
    +'%27&DummyDate='+REPLACE(CONVERT(varchar(25), Date, 120),' ','%20')
    +'#graph|Link' AS 'Tag edit history'
FROM Badges
WHERE Badges.TagBased = 'true'
  AND Badges.Class = ##BadgeClass:int?1##
ORDER BY Date

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results