Giter VIP home page Giter VIP logo

Comments (4)

Truth1987 avatar Truth1987 commented on June 18, 2024

目前為了文章推文即時性,並沒有從網頁抓文章喔@@ 都是直接登入 PTT 解析的。

from pyptt.

eight04 avatar eight04 commented on June 18, 2024

我並不是希望從網頁上抓文章,而是希望有選項把「自動斷行的文字」接回(?)一行。

from pyptt.

Truth1987 avatar Truth1987 commented on June 18, 2024

那怎麼知道...那是自動斷行?

from pyptt.

eight04 avatar eight04 commented on June 18, 2024

我不太確定 PTTLibrary 是怎麼爬的,所以列出大概可行的方案,這篇為例︰
文章代碼(AID): #1R9_jKGC (Test) [ptt.cc] [測試] 123456789012345678901234
文章網址: https://www.ptt.cc/bbs/Test/M.1529346900.A.40C.html

  1. 按小 j 一行一行爬。假如畫面上的第一行被自動斷行,按下 j 會一次跳過兩行以上。

    • 捲到第 12 行
      image
    • 按 j,會一次跳過兩行
      image
    • 然後藉由偵測有幾行被跳過,判斷哪幾行是連在一起的。
    • 缺點︰
      • 如果每行都長一樣,就很難偵測有幾行被跳過。
      • 如果某行長到佔滿一整面,按小 j 會直接跳過一整頁,看不到行尾。
  2. 顯示斷行符號,輸入 om,然後檢查行尾是否是斷行符號
    image
    缺點︰

    • 如果遇到假的斷行符號(自行在行尾加一個亮白色的 \),會判斷錯誤
    • 如果某行長到佔滿一整面,按小 j 會直接跳過一整頁,看不到行尾。
  3. 顯示斷行符號,並且直接截行 owm
    image

    • 偵測到截行符號時,輸入 > 將畫面往右移,取得被截的文字。
    • 整行都取得後(偵測不到截行符號後),輸入對應數量的 < 移回原位。
    • 優點︰
      • 沒有前述方法的缺點
      • 即使有假的截行符號,也會在右移後發現該符號是假的,為使用者文章的一部份。

from pyptt.

Related Issues (20)

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.