Git Product home page Git Product logo

papago-proxy's Introduction

papago-proxy (파파고 프록시)

This is a very simple implementation of papago proxy server, using headless Chrome.

Why?

Sometimes you just want to test with Papago API without signing up for Naver Developers API... This is just for that. This means that you do not need a secret key.

Usage

Test

👉 https://papago-proxy.vercel.app/api/translate?text=hello%20from%20papago%20proxy

👉 https://papago-proxy.vercel.app/api/translate?text=%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94%20%EB%B0%98%EA%B0%91%EC%8A%B5%EB%8B%88%EB%8B%A4%20%EB%8B%B9%EC%8B%A0%EC%9D%98%20%EC%9D%B4%EB%A6%84%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9D%B8%EA%B0%80%EC%9A%94?%20%EC%A0%9C%20%EC%9D%B4%EB%A6%84%EC%9D%80%20%EA%B0%80%EB%82%98%EB%8B%A4%EB%9D%BC%EB%A7%88%EB%B0%94%EC%82%AC%EC%9E%85%EB%8B%88%EB%8B%A4.

(the free plan on Vercel is slow, might need to wait for about 6~7 secs)

Specs

GET /translate?text={text}&wait_for_msec={msec}

querystrings:

  • text: required. text to be translated
  • wait_for_msec: optional. custom option to wait on headless Chrome until translate is fully done. This can be set if the text is too long to be translated in a short time. This is to be removed later.

Logs

Check out https://logflare.app/sources/public/H-kRJ2IfiYbDKsnk

Example

Request:

GET https://papago-proxy.vercel.app/api/translate?text=hello

Response:

{
  "text": "안녕하십니까"
}

Known limitations

  • The free plan on vercel serverless functions only supports running up to 10 secs. It won't allow long sentences to be succesfully translated. The free plan runs quite slowly too, due to memory limitations.
  • As far as I know, this must not be used for commercial purposes. Sign up for Naver developers API and use that if you want some commercial purpose.

Cluster

src/server/server.ts is for using cluster on non-serverless environments. I doubt if it is worth using it.

Todos

  • More language options
  • Deploy to AWS lambda or Azure for a better example

papago-proxy's People

Contributors

9oelm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.