Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Get["/facebook/top/{year:year}"] = parameters =>
  2. {
  3. int year = parameters.year;
  4. //whole year
  5.  
  6. var firstDay = new DateTime(year, 1, 1);
  7. var lastDay = firstDay.AddMonths(12).AddMilliseconds(-1);
  8.  
  9. return GetPostsForPeriod($"Top posty z Facebooka z roku {year}", firstDay, lastDay);
  10. };
  11.  
  12. Get["/facebook/top/{year:year}/{month:month}"] = parameters =>
  13. {
  14. int month = parameters.month;
  15. int year = parameters.year;
  16.  
  17. var firstDay = new DateTime(year, month, 1);
  18. var lastDay = firstDay.AddMonths(1).AddMilliseconds(-1);
  19.  
  20. return GetPostsForPeriod($"Top posty z Facebooka z okresu {firstDay:yyyy-MM-dd} - {lastDay:yyyy-MM-dd}", firstDay, lastDay);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement