Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idea: extend API results to include url #15

Open
jazzsequence opened this issue Mar 14, 2018 · 1 comment
Open

idea: extend API results to include url #15

jazzsequence opened this issue Mar 14, 2018 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@jazzsequence
Copy link
Contributor

jazzsequence commented Mar 14, 2018

In his LoopConf talk Dennis Snell talks about building on existing endpoints as requirements change, rather than rewriting and restructuring APIs or adding additional endpoints for no good reason.

What I'm thinking is that if you have a result like this:

[
  "wind sheffield invasion",
  "gangsta tunes emo",
  "micro-fox",
  "electrobop",
  "lute blues"
]

We could build in the urls for those genres (in this case, same would apply to stories) into the response, e.g.:

[
  {
    "wind sheffield invasion": {
       "url": "https://binaryjazz.us/genrenator/?genre=wind%20sheffield%20invasion"
    }
  },
  {
    "gangsta tunes emo": {
       "url": "https://binaryjazz.us/genrenator/?genre=gangsta%20tunes%20emo"
    }
  },
  {
   "micro-fox": {
      "url": "https://binaryjazz.us/genrenator/?genre=micro-fox"
    }
  },
  {
    "electrobop": {
       "url": "https://binaryjazz.us/genrenator/?genre=electrobop"
    }
  },
  {
    "lute blues": {
       "url": "https://binaryjazz.us/genrenator/?genre=lute%20blues"
    }
  }
]

The result would be more data served by the api, and we'd be able to potentially pull the URLs from the API (and therefore the dynamic name generation in the shortcode from the API) rather than building it (in the shortcode) on the fly. This would potentially solve the issue in #14 as a side-effect.

@jazzsequence jazzsequence added the enhancement New feature or request label Mar 14, 2018
@jazzsequence
Copy link
Contributor Author

jazzsequence commented Mar 14, 2018

This may require some refactoring of the twitter bot if we did this. cc @allisonplus
On the flip side, it would mean the twitter bot could tweet links to the genres.

@jazzsequence jazzsequence added this to the 1.2 milestone Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant