Skip to content

Instantly share code, notes, and snippets.

@matanox
matanox / GithubHelper.scala
Last active December 29, 2015 23:19 — forked from guizmaii/GithubHelper.scala
Helper object parsing the "Link" header of the Github API v3, in Scala
/*
* parses the link header field (http://tools.ietf.org/html/rfc5988) returned by Github's api
* (c.f. https://developer.github.com/guides/traversing-with-pagination/)
*/
trait GithubLinkHeader {
def parse(linkHeader: IndexedSeq[String]): Map[String, String] = {
assert(linkHeader.size == 1)
linkHeader.head.split(',').map { linkEntry =>