Giter Site home page Giter Site logo

jews's Introduction

jews

travis

뉴스 사이트 기사 페이지에 접속하면 뉴스 본문외의 정보를 전부 제거한 뒤 페이지를 재구성하는 스크립트입니다.

프로젝트를 만든 사람이 구글 크롬 브라우저를 사용하기 때문에 크롬을 최우선으로 지원합니다.

릴리즈 기준은 크롬 브라우저에서 전부 잘 동작하는가이므로 업데이트가 있을 경우 크롬 외 브라우저에서는 잘 동작하지 않을 수 있습니다.

설치하기

jews는 뉴스 기사 페이지에서 작동되는 스크립트이며, 자동으로 실행되기 위해서는 UserScript 플러그인의 도움이 필요합니다.

UserScript 플러그인 설치

필요한 UserScript 플러그인은 사용중인 브라우저마다 다르며, 각각의 플러그인은 다음의 링크로 들어가 설치하실 수 있습니다:

스크립트 설치

UserScript 플러그인이 설치됐다면 위 링크를 클릭하여 스크립트 설치 다이얼로그를 띄웁니다.

최상위 경로의 jews.user.js에 대해서...

배포전용 파일은 dist/jews.user.js로 대체되었지만, 유저스크립트 플러그인의 스크립트 자동 업데이트 등을 위해 당분간 저장소 최상위 경로에 jews.user.js 파일은 남겨놓도록 하겠습니다. 한 번 업데이트 되고나면 그 이후로는 dist/jews.user.js로 업데이트될 것입니다.

기여하는 법

버그 제보하기

jews는 github issue tracker를 사용합니다. 이슈는 https://github.com/disjukr/jews/issues 로 제보해주시기 바랍니다.

소스코드로 기여하기

  1. 구현하고 싶은 뉴스 사이트를 정합니다.
    1. 뉴스 사이트가 하단의 지원 사이트 목록에 체크되어있지 않은지 확인합니다.
    2. 목록에 사이트가 없으면 추가합니다.
  2. 구현합니다.
    1. src/sites.js에 뉴스사 이름을 키로 갖는, 주소 패턴 목록을 추가합니다.
    2. src/impl 경로에 jews 객체를 반환하는 모듈을 작성합니다.
      1. 모듈 이름은 뉴스사 이름으로 합니다.
      2. 비동기로 작동해야할 경우 Promise 객체를 반환하면 됩니다.
  3. 지원 사이트 목록에 구현한 항목을 체크하고 Pull Request를 보냅니다.

소스코드 빌드하기

이 프로젝트는 webpack을 사용하여 jews.user.js 파일을 빌드합니다. 웹팩을 사용해서 빌드를 하기 위해 다음의 절차를 따라야 합니다:

  1. nodejs를 설치합니다.
  2. jews가 사용하는 라이브러리들을 설치합니다.
    1. jews 저장소 폴더에서 다음의 명령을 실행합니다: npm install
  3. 다음 중 하나의 명령을 사용해서 빌드를 수행합니다:
    • 테스트용 빌드: npm run build
    • 지속적인 테스트용 빌드: npm run watch
    • 릴리즈용 빌드: npm run production
  4. 저장소의 dist 폴더로 가면 빌드된 jews.user.js 파일을 확인할 수 있습니다.

유의사항

버그 제보 관련

  • 특정 환경에서만 발생하는 버그는 제보시에 특정 환경(브라우저/OS 등)을 명시해주세요.
  • 특정 뉴스사이트나 기사 페이지에서만 발생하는 버그 역시 제보시에 링크를 명시해주세요.

개발 관련

  • jews 객체 반환 시에 아래에 정의된 타입을 따르도록 합니다.
  • 뉴스 페이지에서 해당하는 정보가 없을 경우 undefined값을 채워 넣습니다.
  • 릴리즈는 사람이 직접 할 필요가 없습니다. travis ci를 통해 jews-bot 계정이 자동으로 처리합니다.

jews 타입 정의

아래 타입 정의 스키마는 makise의 문법을 따릅니다.

this is jews

jews is {
    title: string,
    subtitle: string,
    content: html_fragment,
    timestamp: {
        created: Date,
        lastModified: Date
    },
    reporters: [reporter, ...],
    cleanup: Function
}

reporter is {
    name: string,
    mail: mail_address
}

html_fragment is string
mail_address is string

털어내기

몇몇 뉴스 사이트들은 사이트 재구성 뒤에도 광고가 남아있을 수 있습니다. 재구성을 했는데도 남는 광고들은 jews.cleanup를 사용하여 털어내도록 합시다.

jews.cleanup 함수는 사이트 재구성이 일어난 뒤, 1초 주기로 매 번 호출됩니다.

지원 사이트

jews's People

Contributors

dahlia avatar devxoul avatar disjukr avatar item4 avatar kall avatar khris avatar lifthrasiir avatar minhoryang avatar saschanaz avatar snack-x avatar teslamint avatar theeluwin avatar tribela avatar xnuk avatar yous 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.