Git Product home page Git Product logo

foaas's People

Contributors

agaman avatar brettminnie avatar coatsnmore avatar debadri16 avatar dekaos avatar dependabot[bot] avatar eddelbuettel avatar hasimir avatar jerryaldrichiii avatar khoding avatar kiwiroy avatar lparkermg avatar maetl avatar manjunatha-d avatar mariobodemann avatar martinschaef avatar modelorona avatar ntwb avatar petedmarsh avatar philip2156 avatar philipmuir avatar pzurek avatar spacedrabbit avatar stephen-riley avatar thiagoarrais avatar tomdionysus avatar ultimagriever avatar waitconference avatar walleiki avatar xenph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foaas's Issues

API limitation

First off,

http://www.foaas.com/awesome/Me

However, I noticed that the result "Fuck diabetes - Me" isn't possible via your API. I wanted to apply the /:thing/:from endpoint, but it ended up getting the /diabetes/:from endpoint instead. Consider disambiguating the general /:thing/from case from specific foaas cases..

json response

hi, i'm trying to get a json response from your api but can only get html. i want to do a funny "f*ck off" postcard website.
maybe i'm not calling the correct endpoint, or i'm missing some headers. at the moment i'm using postman for testing. some help would be nice.

thanks,
tiago

/you/:name/:from seems to have disappeared

There is nothing here:

edd@max:~/git/foaas(master)$ git pull --all  
Fetching origin
Fetching parentrepo
Already up-to-date.
edd@max:~/git/foaas(master)$ git merge parentrepo/master 
Already up-to-date.
edd@max:~/git/foaas(master)$ find . -name \*you\*
edd@max:~/git/foaas(master)$ 

And hitting the URL redirects to the main page. Yet the docs still have

you/:name/:from
Will return content of the form 'Fuck you, :name. - :from', e.g. /you/Tom/Chris will return 'Fuck you, Tom - Chris'

Information leakage when sending invalid requests.

curl -H "Content-Type: application/json" http://foaas.herokuapp.com/

Error: invalid json
  at Object.exports.error (/app/node_modules/express/node_modules/connect/lib/utils.js:44:13)
  at IncomingMessage.<anonymous> (/app/node_modules/express/node_modules/connect/lib/middleware/json.js:68:73)
  at IncomingMessage.<anonymous> (/app/node_modules/newrelic/node_modules/continuation-local-storage/context.js:74:17)
  at IncomingMessage.emit (events.js:92:17)
  at IncomingMessage.emitted [as emit] (/app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/emitter-listener/listener.js:122:21)
  at _stream_readable.js:943:16
  at /app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
  at process._tickCallback (node.js:419:13)

Who the fuck are you anyway?

A nice quote from the internet: "Who the fuck are you anyway, :company, why are you stirring up so much trouble, and, who pays you?"

Typo

under Roadmap FOASS should be FOAAS

app.use() requires middleware functions

Maybe you should consider fixating some of the dependency versions. It seems there are some API changes in express and related packages. Getting this:

TypeError: app.use() requires middleware functions
  at EventEmitter.use (/Users/kewisch/github/foaas/node_modules/express/lib/application.js:209:11)
  at EventEmitter.wrappedAppUse [as use] (/Users/kewisch/github/foaas/node_modules/newrelic/lib/instrumentation/express.js:348:11)
  at Object.module.exports.register (/Users/kewisch/github/foaas/lib/filters/i18n.coffee:17:9)
  at FOAAS.module.exports.FOAAS.loadFilters (/Users/kewisch/github/foaas/lib/foaas.coffee:90:14)
  at FOAAS.loadFilters (/Users/kewisch/github/foaas/lib/foaas.coffee:1:1)
  at new FOAAS (/Users/kewisch/github/foaas/lib/foaas.coffee:42:6)
  at Object.<anonymous> (/Users/kewisch/github/foaas/lib/server.coffee:6:13)
  at Object.<anonymous> (/Users/kewisch/github/foaas/lib/server.coffee:1:1)
  at Module._compile (module.js:456:26)

Retard? Really?

It seems rather odd that I have to bring up the fact that calling someone a retard or fucktard is uncool. It's a blight on an otherwise wonderful site.

Language filter broken in text/plain mode in 0.1.7?

I was just updating rfoaas to the new services in 0.1.6 and noticed tests failing compared "expected" versus received. I no longer get the translations:

R> off(name=name, from=from, language="de")
[1] "Fuck off, jemand. - Me"
R> off(name=name, from=from, filter="shoutcloud", language="de") 
[1] "FUCK OFF, JEMAND. - ME"
R> 

That uses to return "Verpiss dich, jemand. - Me", translated to German.

If I hit the URL in the browser, it works. In text/plain mode, as used by rfooas, it fails.

Here is a cmdline invocation where I added an explicit print of the REST URL I sent:

edd@max:~/git$ r -lrfoaas  -e 'print(off("A", "B", language="de"))'
[1] "http://foaas.com/off/A/B?i18n=de"
[1] "Fuck off, A. - B"
edd@max:~/git$ 

Using shoutcloud and i18n filter together doesn't work

The documentation says:

Filters can be used in combinations, e.g. http://foaas.com/off/Tom/Everyone?shoutcloud&i18n=de

But, if you go to that URL you get:

<html><head> <title>FOAAS - FUCK OFF, TOM. - - EVERYONE</title> <meta charset="utf-8"> <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> </head> <body style="margin-top:40px;"> <div class="container"> <div id="view-10" view=""><div class="hero-unit"> <h1>FUCK OFF, TOM.</h1> <p><em>- EVERYONE</em></p> </div> </div> </div> <script async="" src="//www.google-analytics.com/analytics.js"></script><script>!function(a,b,c,d,e,f,g){a.GoogleAnalyticsObject=e,a[e]=a[e]||function(){(a[e].q=a[e].q||[]).push(arguments)},a[e].l=1*new Date,f=b.createElement(c),g=b.getElementsByTagName(c)[0],f.async=1,f.src=d,g.parentNode.insertBefore(f,g)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-42551488-1","herokuapp.com"),ga("send","pageview");</script>  </body></html>

i.e. the message is SHOUTY but not in German.

/random/ endpoint

I frequently use foaas.com but find it difficult to select an endpoint from the many endpoints available.

It might be nice to add a /random/:foo/:bar endpoint that would select a random action and apply it, producing different results each time.

I can hack on a PR for this when I get time, just posting this here incase someone else might find this useful in the mean-time.

/field endpoint inputs seem reversed

I believe /field/:name/:from/:reference should be /field/:from/:name/:reference and consequently:

'And :from said unto :name, "Verily, cast thine eyes upon the field in which I grow my fucks", and :name gave witness unto the field, and saw that it was barren. - :reference'

Slack Integration

Should return a Slack outgoingwebhook compatible JSON format to use

parameters do not match docs for /field/:name/:from/:reference

Docs say:

/field/:name/:from/:reference

Will return content of the form 'And :from said unto :name, "Verily, cast thine eyes upon the field in which I grow my fucks", and :name gave witness unto the field, and saw that it was barren. - :reference'

But :from and :name are reversed in the response.

╭─{ yaauie @ beorn in ~ }
╰─○ curl -H 'Accept: text/plain' http://foaas.com/field/:name/:from/:reference
And :name said unto :from, 'Verily, cast thine eyes upon the field in which I grow my fucks', and :from gave witness unto the field, and saw that it was barren. - :reference%
[success]

Add /horse/:from

/horse/:from returns "Fuck you and the horse you rode in on. -:from

i18n: 'DEV' IS AN INVALID TARGET LANGUAGE when using curl and sending ?i18n

Example below:

bacondropped@bacontop~> curl -H 'Accept: text/plain' http://www.foaas.com/back/Sir/I -vv
*   Trying 104.31.79.186...
* Connected to www.foaas.com (104.31.79.186) port 80 (#0)
> GET /back/Sir/I HTTP/1.1
> Host: www.foaas.com
> User-Agent: curl/7.47.0
> Accept: text/plain
> 
< HTTP/1.1 200 OK
< Date: Tue, 21 Jun 2016 14:03:41 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 27
< Connection: keep-alive
< Set-Cookie: __cfduid=d78a8a5fffeed8ed5944884d93321973d1466517820; expires=Wed, 21-Jun-17 14:03:40 GMT; path=/; domain=.foaas.com; HttpOnly
< X-Powered-By: Express
< X-Clacks-Overhead: GNU Terry Pratchett
< Set-Cookie: i18next=dev; path=/; expires=Wed, 21 Jun 2017 14:03:41 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Headers: Content-Type
< Etag: W/"1b-3nlA/KrpvegVP+fNIFiSOg"
< Via: 1.1 vegur
< Server: cloudflare-nginx
< CF-RAY: 2b68015d144c4e48-DME
< 
* Connection #0 to host www.foaas.com left intact
Sir, back the fuck off. - I⏎
bacondropped@bacontop~> curl -H 'Accept: text/plain' http://www.foaas.com/back/Sir/I\?i18n=ja -vv
*   Trying 104.31.79.186...
* Connected to www.foaas.com (104.31.79.186) port 80 (#0)
> GET /back/Sir/I?i18n=ja HTTP/1.1
> Host: www.foaas.com
> User-Agent: curl/7.47.0
> Accept: text/plain
> 
< HTTP/1.1 200 OK
< Date: Tue, 21 Jun 2016 14:04:03 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 54
< Connection: keep-alive
< Set-Cookie: __cfduid=d2024289d6f0895b68000f492f5791ff71466517843; expires=Wed, 21-Jun-17 14:04:03 GMT; path=/; domain=.foaas.com; HttpOnly
< X-Powered-By: Express
< X-Clacks-Overhead: GNU Terry Pratchett
< Set-Cookie: i18next=dev; path=/; expires=Wed, 21 Jun 2017 14:04:03 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Headers: Content-Type
< Etag: W/"36-pBDiKY4XNamEPtq2uCyanA"
< Via: 1.1 vegur
< Server: cloudflare-nginx
< CF-RAY: 2b6801e7569c4e60-DME
< 
* Connection #0 to host www.foaas.com left intact
サー、性交をバックオフにします。   ●⏎ 
bacondropped@bacontop~> curl -H 'Accept: text/plain' http://www.foaas.com/back/Sir/I\?i18n -vv
*   Trying 104.31.79.186...
* Connected to www.foaas.com (104.31.79.186) port 80 (#0)
> GET /back/Sir/I?i18n HTTP/1.1
> Host: www.foaas.com
> User-Agent: curl/7.47.0
> Accept: text/plain
> 
< HTTP/1.1 200 OK
< Date: Tue, 21 Jun 2016 14:04:31 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 175
< Connection: keep-alive
< Set-Cookie: __cfduid=d11dc779660ac0fc00c2a5cfe696b421a1466517870; expires=Wed, 21-Jun-17 14:04:30 GMT; path=/; domain=.foaas.com; HttpOnly
< X-Powered-By: Express
< X-Clacks-Overhead: GNU Terry Pratchett
< Set-Cookie: i18next=dev; path=/; expires=Wed, 21 Jun 2017 14:04:31 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Headers: Content-Type
< Etag: W/"af-zRPh9T1DZO8Nj9NWMVfmag"
< Via: 1.1 vegur
< Server: cloudflare-nginx
< CF-RAY: 2b680294b5454ef6-DME
< 
* Connection #0 to host www.foaas.com left intact
'DEV' IS AN INVALID TARGET LANGUAGE . EXAMPLE: LANGPAIR=EN|IT USING 2 LETTER ISO OR RFC3066 LIKE ZH-CN. ALMOST ALL LANGUAGES SUPPORTED BUT SOME MAY HAVE NO CONTENT   undefined⏎

Since curl does not send the Accept-Language header, the failure is ok. However, I think it would be robust to fall back to a default behavior in this case, for instance, refusing to translate and sending the string in English instead.

Thoughts?

FOAAS and FOAD an exercise in codependence

It's nice to see this project being picked up again, but obviously it was almost abandoned for a time (well, more like people got very busy). Anyway, during that time I wandered off on my own tangent, which included a local solution. Specifically a Python script to be run locally and since used quite effectively with Twitter, IRC and occasionally through an SMS gateway. That little project is here and is dual licensed under the GPLv3 and the WTFNMFPL, which is my WTFPL variant with the CYA clause added.

It's still a work in progress (the recent addition of the -e and -s flags means there's large sections to update now) and I doubt the Python 3 code (it needs Python 3.2 or higher) itself will be of benefit here, but some of the options in it might be the sort of thing you'd want to copy over. So feel free to pillage. Currently there's about 175 options, most of which have variants depending on whether they're directed at someone or not (it says 178, but 3 of those aren't regular options; one is for extracting info about the program, one lists the options and one is for looking up offensive acronyms). There are a couple of original things in there too, including some rephrasing of certain Latin phrases, but there's also a lot of older well known phrases and a few which were harvested out of the pull requests for FOAAS (sometimes verbatim and sometimes modified).

Anyway, this isn't an issue asking you to do something so you can close it as soon as you've read it. This is just a little FYI that my script exists and can be a source of phrases or endpoints for FOAAS. If you want a list of which options in my script were my original content I can skim through it and tell you (off the top of my head, though, these ones definitely are: custode, kirsan, omnia, priapus, vvv and all the psycho ones; several of which are original variations on Latin phrases or quotations).

Documentation

Normally, docs provide the logical foundation, or motivating factors for a project.

I would really, truly love to see that added. FOAAS provides new and exciting ways to communicate with, and about, coworkers.

Fascinating lacks a :name parameter

We should be able to address someone specifically with "fascinating". This would be useful in irc context, when a lot of people are talking nonsense but not everyone. This would allow to spot precisely who needs to shut the fuck up.

The api could be of the form :

/fascinating/:name/:from

Will return content of the form 'Fascinating story :name, in what chapter do you shut the fuck up? - :from'. 

:name could be optional, in which case we don't break existing client.

MyMemory quota depleted

Trying to use the ?i18n option I got this error message:

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. VISIT HTTP://MYMEMORY.TRANSLATED.NET/DOC/QUOTAREACHED TO TRANSLATE MORE

I think a simply check it's enough to hide this message and probably return the non-translated response? I'll try to make some time to push a PR.

btw, awesome work/

Add "/me/:from" option

Given that an imperative instruction about oneself can be used as an expression of amazement or bewilderment, it might be a useful addition. I'm not sure I'd choose to make a pull request, chicken that I am.

/field text has :name and :from reversed

The output of /field is currently as follows:

"And :name said unto :from, 'Verily, cast thine eyes upon the field in which I grow my fucks', and :from gave witness unto the field, and saw that it was barren."

It would make more sense if :name and :from were reversed.

Internal server error when passing invalid Accept header

Steps to reproduce

$ ipython3
Python 3.5.1+ (default, Mar 30 2016, 22:46:26) 
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import requests

In [2]: requests.get('https://www.foaas.com/version/', headers={'Accept':'example.invalid'}).text
Out[2]: 'Internal Server Error\n'

In [3]: requests.get('https://www.foaas.com/version/', headers={'Accept':'example.invalid'}).status_code
Out[3]: 500

Behavior change?

FOAAS used to return text/plain which is something rfoaas relied upon.

Now we get html:

R> library(rfoaas)
R> off("XYZ")                     # manually indenting response block
[1] "<html> <head> <title>FOAAS - Fuck off, XYZ. - - edd</title> <meta charset=\"utf-8\"> 
<link href=\"//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css\"
 rel=\"stylesheet\"> </head> <body style=\"margin-top:40px;\"> <div class=\"container\"> 
<div id=\"view-10\" view=\"\"><div class=\"hero-unit\"> <h1>Fuck off, XYZ.</h1> 
<p><em>- edd</em></p> </div> </div> </div> 
<script>!function(a,b,c,d,e,f,g){a.GoogleAnalyticsObject=e,a[e]=a[e]||function(){(a[e].q=
a[e].q||[]).push(arguments)},a[e].l=1*new Date,f=b.createElement(c),
g=b.getElementsByTagName(c)[0],f.async=1,
f.src=d,g.parentNode.insertBefore(f,g)}(
window,document,\"script\",\"//www.google-analytics.com/analytics.js\",\"ga\"),
ga(\"create\",\"UA-42551488-1\",\"herokuapp.com\"),ga(\"send\",\"pageview\");
</script> </body> </html>"
R> 

I presume I can code around it, but it would be nice not to force every client to do do.

Basic Fucks needed

1.) What in the actual fuck {to} - {from}
2.) {to} fuck you fucking fuckers - {from}
3.) {to} fuck you with the fury of a thousand suns - {from}

Non RESTful response for what should be 404's

When you type in any url which isn't supported, you land on the homepage! FUCK OFF this is not RESTful =}

You probably should have a 404 page with a "did you mean", or a back to homepage button

Some fuck-offs are not fuck-offs at all

Let me quote the mission statement:

FOAAS (Fuck Off As A Service) provides a modern, RESTful, scalable solution to the common problem of telling people to fuck off.

According to this very definition, please remove "xmas", "life", and "awesome", as they're probably solving a different problem and are not actually suitable for telling people to fuck off.

Setup CI

Lets use travis to test & deploy once a PR is merged.

Flying seems borked

As I understand the doc, \flying:from should provide the fixed text "I don't give a flying..."

But the code seems to have a copy & paste error from the previous :thing entry as

app.get '/:flying/:from', (req, res) ->
message = "I don't give a flying fuck. - #{req.params.from}."

Should that not be

app.get '/flying/:from', (req, res) ->
message = "I don't give a flying fuck. - #{req.params.from}."

Cheers, Dirk (who added rfoaas to provide all this goodness from within R)

Adds a "madison" action

This would generate something like :

/madison/:name/:from
«What you've just said is one of the most insanely idiotic things I have ever heard, :name. At no point in your rambling, incoherent response were you even close to anything that could be considered a rational thought. Everyone in this room is now dumber for having listened to it. I award you no points :name, and may God have mercy on your soul.

  • :from
    »

From http://www.youtube.com/watch?v=5hfYJsQAhl0&html5=1
( Jim Downey in "Billy Madison")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.