jekyll-bluesky 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85f2af2d74ed6e880920b931d53b83e48dd060426762265193a44a10ac6d0441
4
- data.tar.gz: e0a54a887ab33a4639600e6ecd00099661a81198dddbaf5859210a1bae2644c2
3
+ metadata.gz: 179c2fb2821b468b6c7b23798efd0b4287055a2024e879e2ce8555772d6eb03c
4
+ data.tar.gz: 1c9c2121eb2b825f1ad449991a5ddbee65d4af159642d2d33bef84d149ed22b4
5
5
  SHA512:
6
- metadata.gz: 54b30a60736bc6b5812a7a283c87ffa336022d3ed5f6c3f80da66f0ac7658a247f3677e1e0f95fc7defc3a16f0c5d06abc72bea695aa2470f0ec690bd15f0318
7
- data.tar.gz: 6e273c19b4a1a60a37e58b93b2f81d3cd3069bb0a56227ef17cf5f7f9540130220979e0dd5a4b476631bfdc89275f5575e2cd8dee91982d94d5757bdd665c6af
6
+ metadata.gz: e7fc45af09ee3430f0b2a8fede4cffd3a9edf1b548f0c5cffc6c84784360db176e8a365bb06b66efade9e4fd3208f3b046d9e175add9a9d7448890223d1a7519
7
+ data.tar.gz: 16e2690e404e7100e849be1874776cdd3bcab8801a726f252e368381f455d42eb4117c330fe0a0fb621c0336d87974f1a9112fe3951e10b1ce3886af6667b0dc
@@ -1,6 +1,6 @@
1
1
  # lib/jekyll-bluesky/version.rb
2
2
  module Jekyll
3
3
  module Bluesky
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-bluesky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felipe Dias
@@ -47,9 +47,8 @@ executables: []
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
- - lib/jekyll-bluesky/bluesky.rb
50
+ - lib/jekyll-bluesky.rb
51
51
  - lib/jekyll-bluesky/version.rb
52
- - lib/jekyll_bluesky.rb
53
52
  homepage: https://github.com/fdoliv/jekyll-bluesky
54
53
  licenses:
55
54
  - MIT
@@ -1,67 +0,0 @@
1
- # lib/jekyll-bluesky/bluesky.rb
2
- module Jekyll
3
- module Bluesky
4
- class Client
5
- API_URL = "https://public.api.bsky.app" # Substitua pela URL correta da API do Bluesky
6
-
7
- def self.fetch_post(actor, limit)
8
- response = HTTP.get("#{API_URL}/xrpc/app.bsky.feed.getAuthorFeed?actor=#{actor}&limit=#{limit}&filter=posts_and_author_threads")
9
- if response.status.success?
10
- data = JSON.parse(response.body)
11
- format_post(data)
12
- else
13
- "Error fetching post from Bluesky."
14
- end
15
- end
16
-
17
- def self.format_post(data)
18
- posts = data["feed"] # Acessa a lista de posts
19
- posts.map do |post|
20
- post_data = post["post"]
21
- author = post_data["author"]
22
- record = post_data["record"]
23
- embed = post_data["embed"]
24
-
25
- # Extrai o texto do post
26
- text = record["text"]
27
-
28
- # Formata o nome do autor e o handle
29
- author_name = author["displayName"]
30
- author_handle = author["handle"]
31
-
32
- # Extrai a imagem (se houver)
33
- image_html = ""
34
- if embed && embed["$type"] == "app.bsky.embed.images#view"
35
- image_html = embed["images"].map do |image|
36
- <<~HTML
37
- <img src="#{image['thumb']}" alt="#{image['alt']}" class="bluesky-image" />
38
- HTML
39
- end.join
40
- end
41
-
42
- # Gera o HTML do post
43
- <<~HTML
44
- <div class="bluesky-post">
45
- <div class="bluesky-author">
46
- <img src="#{author['avatar']}" alt="#{author_name}" class="bluesky-avatar" />
47
- <div class="bluesky-author-info">
48
- <strong>#{author_name}</strong>
49
- <small>@#{author_handle}</small>
50
- </div>
51
- </div>
52
- <div class="bluesky-content">
53
- <p>#{text}</p>
54
- #{image_html}
55
- </div>
56
- <div class="bluesky-stats">
57
- <span>❤️ #{post_data["likeCount"]}</span>
58
- <span>🔁 #{post_data["repostCount"]}</span>
59
- <span>💬 #{post_data["replyCount"]}</span>
60
- </div>
61
- </div>
62
- HTML
63
- end.join("\n")
64
- end
65
- end
66
- end
67
- end
File without changes