このコミットが含まれているのは:
守矢諏訪子 2022-05-25 21:59:36 +09:00
コミット 360d9a27a5
9個のファイルの変更24行の追加10行の削除

ファイルの表示

@ -1,6 +1,5 @@
FROM nimlang/nim:1.6.2-alpine-regular as nim
LABEL maintainer="setenforce@protonmail.com"
EXPOSE 8080
RUN apk --no-cache add libsass-dev pcre
@ -16,8 +15,9 @@ RUN nimble build -d:danger -d:lto -d:strip \
FROM alpine:latest
WORKDIR /src/
RUN apk --no-cache add pcre
RUN apk --no-cache add pcre ca-certificates
COPY --from=nim /src/nitter/nitter ./
COPY --from=nim /src/nitter/nitter.example.conf ./nitter.conf
COPY --from=nim /src/nitter/public ./public
EXPOSE 8080
CMD ./nitter

ファイルの表示

@ -12,6 +12,11 @@ services:
depends_on:
- nitter-redis
restart: unless-stopped
healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:8080/Jack/status/20 || exit 1
interval: 30s
timeout: 5s
retries: 2
nitter-redis:
image: redis:6-alpine
@ -20,6 +25,11 @@ services:
volumes:
- nitter-redis:/data
restart: unless-stopped
healthcheck:
test: redis-cli ping
interval: 30s
timeout: 5s
retries: 2
volumes:
nitter-redis:

ファイルの表示

@ -189,6 +189,7 @@ proc parseTweet(js: JsonNode): Tweet =
replyId: js{"in_reply_to_status_id_str"}.getId,
text: js{"full_text"}.getStr,
time: js{"created_at"}.getTime,
source: getSource(js),
hasThread: js{"self_thread"}.notNull,
available: true,
user: User(id: js{"user_id_str"}.getStr),

ファイルの表示

@ -133,6 +133,10 @@ proc getTombstone*(js: JsonNode): string =
result = js{"tombstoneInfo", "richText", "text"}.getStr
result.removeSuffix(" Learn more")
proc getSource*(js: JsonNode): string =
let src = js{"source"}.getStr
result = src.substr(src.find('>') + 1, src.rfind('<') - 1)
proc extractSlice(js: JsonNode): Slice[int] =
result = js["indices"][0].getInt ..< js["indices"][1].getInt

ファイルの表示

@ -174,6 +174,7 @@ type
available*: bool
tombstone*: string
location*: string
source*: string
stats*: TweetStats
retweet*: Option[Tweet]
attribution*: Option[User]

ファイルの表示

@ -78,8 +78,11 @@ proc renderPhotoRail(profile: Profile): VNode =
tdiv(class="photo-rail-grid"):
for i, photo in profile.photoRail:
if i == 16: break
let photoSuffix =
if "format" in photo.url or "placeholder" in photo.url: ""
else: ":thumb"
a(href=(&"/{profile.user.username}/status/{photo.tweetId}#m")):
genImg(photo.url & (if "format" in photo.url: "" else: ":thumb"))
genImg(photo.url & photoSuffix)
proc renderBanner(banner: string): VNode =
buildHtml():

ファイルの表示

@ -344,7 +344,7 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
renderQuote(tweet.quote.get(), prefs, path)
if mainTweet:
p(class="tweet-published"): text getTime(tweet)
p(class="tweet-published"): text &"{getTime(tweet)} · {tweet.source}"
if tweet.mediaTags.len > 0:
renderMediaTags(tweet.mediaTags)

ファイルの表示

@ -25,11 +25,6 @@ card = [
]
no_thumb = [
['Bountysource/status/1141879700639215617',
'Post a bounty on kivy/plyer!',
'Automation and Screen Reader Support',
'bountysource.com'],
['brent_p/status/1088857328680488961',
'Hts Nim Sugar',
'hts-nim is a library that allows one to use htslib via the nim programming language. Nim is a garbage-collected language that compiles to C and often has similar performance. I have become very...',

ファイルの表示

@ -3,7 +3,7 @@ from parameterized import parameterized
text = [
['elonmusk/status/1138136540096319488',
'Tesla Owners Online', '@Model3Owners',
'Trev Page', '@Model3Owners',
"""As of March 58.4% of new car sales in Norway are electric.
What are we doing wrong? reuters.com/article/us-norwa"""],