Compare commits
No commits in common. "97419c483e426df2071200ba979dde71933e99c2" and "c0e4c8502881187ccfaa94cab8e407bebf96b497" have entirely different histories.
97419c483e
...
c0e4c85028
@ -393,16 +393,3 @@ v0.6.22
|
|||||||
|
|
||||||
- Add background scraping jobs for Bookmarks and logged-in user's User Feed
|
- Add background scraping jobs for Bookmarks and logged-in user's User Feed
|
||||||
- Manually rescraping a User Feed now re-downloads user's profile and banner images as well
|
- Manually rescraping a User Feed now re-downloads user's profile and banner images as well
|
||||||
|
|
||||||
v0.7.0
|
|
||||||
------
|
|
||||||
|
|
||||||
- PKG: Type definitions are now in `pkg/persistence` instead of `pkg/scraper`
|
|
||||||
- BUGFIX: fix notifications page not having user's "likes" filled out on tweets
|
|
||||||
- Compound notifications now tell you how many tweets were "liked", how many users followed you, etc
|
|
||||||
|
|
||||||
v0.7.1
|
|
||||||
------
|
|
||||||
|
|
||||||
- BUGFIX: fix banned users getting their user info (followers count, profile image, display name) getting erased
|
|
||||||
- PKG: webserver is now a public package
|
|
||||||
|
@ -4,7 +4,7 @@ set -x
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# General build flags
|
# General build flags
|
||||||
FLAGS="-s -w -X gitlab.com/offline-twitter/twitter_offline_engine/pkg/webserver.use_embedded=true"
|
FLAGS="-s -w -X gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver.use_embedded=true"
|
||||||
|
|
||||||
# Check for the `--static` flag and consume it
|
# Check for the `--static` flag and consume it
|
||||||
USE_STATIC=false
|
USE_STATIC=false
|
||||||
|
@ -349,11 +349,6 @@ test $(sqlite3 twitter.db "select is_stub, user_id = 0x4000000000000000 from twe
|
|||||||
tw fetch_user nancytracker
|
tw fetch_user nancytracker
|
||||||
test "$(sqlite3 twitter.db "select is_banned from users where handle='nancytracker'")" = "1"
|
test "$(sqlite3 twitter.db "select is_banned from users where handle='nancytracker'")" = "1"
|
||||||
|
|
||||||
# Fetch a thread with a banned user in it; test no-clobbering of the existing user data
|
|
||||||
sqlite3 twitter.db "insert into users (id, handle, display_name, profile_image_url, banner_image_local_path, followers_count) values (1595500307374829568, 'spandrell3', 'Spandrell', 'Profile URL', 'Banner Local', 10)"
|
|
||||||
tw fetch_tweet https://twitter.com/spandrell3/status/1709580398026805736
|
|
||||||
test "$(sqlite3 twitter.db "select display_name, profile_image_url, banner_image_local_path, followers_count, is_banned from users where handle='spandrell3'")" = "Spandrell|Profile URL|Banner Local|10|1"
|
|
||||||
|
|
||||||
|
|
||||||
# Fetch a user with "600x200" banner image
|
# Fetch a user with "600x200" banner image
|
||||||
tw fetch_user AlexKoppelman # This is probably kind of a flimsy test
|
tw fetch_user AlexKoppelman # This is probably kind of a flimsy test
|
||||||
|
@ -112,9 +112,6 @@ func full_save_tweet_trove(trove TweetTrove) {
|
|||||||
// Mark them as deleted.
|
// Mark them as deleted.
|
||||||
// Handle and display name won't be updated if the user exists.
|
// Handle and display name won't be updated if the user exists.
|
||||||
updated_user = User{ID: u_id, DisplayName: "<Unknown User>", Handle: "<UNKNOWN USER>", IsDeleted: true}
|
updated_user = User{ID: u_id, DisplayName: "<Unknown User>", Handle: "<UNKNOWN USER>", IsDeleted: true}
|
||||||
} else if errors.Is(err, scraper.ErrUserIsBanned) {
|
|
||||||
// Mark them as banned (also won't clobber handle and display name)
|
|
||||||
updated_user = User{ID: u_id, DisplayName: "<Unknown User>", Handle: "<UNKNOWN USER>", IsBanned: true}
|
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
panic(fmt.Errorf("error scraping conflicting user (ID %d): %w", u_id, err))
|
panic(fmt.Errorf("error scraping conflicting user (ID %d): %w", u_id, err))
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,9 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver"
|
||||||
. "gitlab.com/offline-twitter/twitter_offline_engine/pkg/persistence"
|
. "gitlab.com/offline-twitter/twitter_offline_engine/pkg/persistence"
|
||||||
"gitlab.com/offline-twitter/twitter_offline_engine/pkg/scraper"
|
"gitlab.com/offline-twitter/twitter_offline_engine/pkg/scraper"
|
||||||
"gitlab.com/offline-twitter/twitter_offline_engine/pkg/webserver"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Global variable referencing the open data profile
|
// Global variable referencing the open data profile
|
||||||
|
@ -14,12 +14,12 @@ if [[ -z "$1" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Always use static build for windows
|
# Always use static build for windows
|
||||||
FLAGS="-s -w -X gitlab.com/offline-twitter/twitter_offline_engine/pkg/webserver.use_embedded=true"
|
FLAGS="-s -w -X gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver.use_embedded=true"
|
||||||
SPECIAL_FLAGS_FOR_STATIC_BUILD="-linkmode=external -extldflags=-static"
|
SPECIAL_FLAGS_FOR_STATIC_BUILD="-linkmode=external -extldflags=-static"
|
||||||
|
|
||||||
# Add an application icon using `windres` and `.syso`
|
# Add an application icon using `windres` and `.syso`
|
||||||
# The `.syso` should be picked up automatically, since it's in the same directory we run `go build` from`
|
# The `.syso` should be picked up automatically, since it's in the same directory we run `go build` from`
|
||||||
echo '1 ICON "../pkg/webserver/static/twitter.ico"' > /tmp/icon.rc
|
echo '1 ICON "../internal/webserver/static/twitter.ico"' > /tmp/icon.rc
|
||||||
x86_64-w64-mingw32-windres /tmp/icon.rc -o icon.syso
|
x86_64-w64-mingw32-windres /tmp/icon.rc -o icon.syso
|
||||||
|
|
||||||
go build -ldflags="$FLAGS $SPECIAL_FLAGS_FOR_STATIC_BUILD -X main.version_string=$1" -o twitter.exe ./twitter
|
go build -ldflags="$FLAGS $SPECIAL_FLAGS_FOR_STATIC_BUILD -X main.version_string=$1" -o twitter.exe ./twitter
|
||||||
|
@ -136,6 +136,9 @@ TOOD: notifications-duplicate-bug (#scraper, #bug)
|
|||||||
TODO: dm-reaccs-popup-list (#dms, #webserver, #reaccs)
|
TODO: dm-reaccs-popup-list (#dms, #webserver, #reaccs)
|
||||||
- on-click popup showing who sent which reacc
|
- on-click popup showing who sent which reacc
|
||||||
|
|
||||||
|
TODO: detect-banned-users-when-scraping-tweets (#scraper, #bug)
|
||||||
|
- banned users aren't detected when scraping tweets
|
||||||
|
|
||||||
TODO: sqlite-query-optimizing
|
TODO: sqlite-query-optimizing
|
||||||
- https://sqlite.org/cli.html#index_recommendations_sqlite_expert_
|
- https://sqlite.org/cli.html#index_recommendations_sqlite_expert_
|
||||||
- https://sqlite.org/eqp.html
|
- https://sqlite.org/eqp.html
|
||||||
@ -147,8 +150,3 @@ TODO: deprecated-offline-follows
|
|||||||
- Offline Follows doesn't do much userful anymore
|
- Offline Follows doesn't do much userful anymore
|
||||||
|
|
||||||
TODO: offline-timeline-vs-user-timeline
|
TODO: offline-timeline-vs-user-timeline
|
||||||
|
|
||||||
TODO: go-stdlib-path-vs-filepath (#code-quality)
|
|
||||||
|
|
||||||
TODO: show-retweet-icon-in-ui (#webserver)
|
|
||||||
- The UI should show whether the active user has retweeted the tweet, same as with "likes"
|
|
||||||
|
@ -1,9 +1,3 @@
|
|||||||
Bash completions
|
Bash completions
|
||||||
|
|
||||||
https://opensource.com/article/18/3/creating-bash-completion-script
|
https://opensource.com/article/18/3/creating-bash-completion-script
|
||||||
|
|
||||||
|
|
||||||
Enable with:
|
|
||||||
```
|
|
||||||
complete -C 'go run ./twitter autocomplete "$@"' twitter
|
|
||||||
```
|
|
||||||
|
8
doc/tasks/notifications-mark-as-read.todo
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Notifications mark as read
|
||||||
|
|
||||||
|
- it uses cursors. so, to mark notifications as read:
|
||||||
|
- scrape notifications
|
||||||
|
- extract top cursor
|
||||||
|
- use that as the cursor value to mark as read
|
||||||
|
|
||||||
|
DAABDAABCgABFDzeDIfVUAIIAAIAAAABCAADiJONcggABOxI6DUACwACAAAAC0FaSHRBaThqLUN3CAADyS991gAA
|
@ -11,8 +11,8 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"golang.org/x/net/html"
|
"golang.org/x/net/html"
|
||||||
|
|
||||||
|
"gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver"
|
||||||
. "gitlab.com/offline-twitter/twitter_offline_engine/pkg/persistence"
|
. "gitlab.com/offline-twitter/twitter_offline_engine/pkg/persistence"
|
||||||
"gitlab.com/offline-twitter/twitter_offline_engine/pkg/webserver"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMessagesIndexPageRequiresActiveUser(t *testing.T) {
|
func TestMessagesIndexPageRequiresActiveUser(t *testing.T) {
|
@ -9,8 +9,8 @@ import (
|
|||||||
"github.com/andybalholm/cascadia"
|
"github.com/andybalholm/cascadia"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver"
|
||||||
. "gitlab.com/offline-twitter/twitter_offline_engine/pkg/persistence"
|
. "gitlab.com/offline-twitter/twitter_offline_engine/pkg/persistence"
|
||||||
"gitlab.com/offline-twitter/twitter_offline_engine/pkg/webserver"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type CapturingWriter struct {
|
type CapturingWriter struct {
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 356 B |
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 982 B |
Before Width: | Height: | Size: 297 B After Width: | Height: | Size: 297 B |
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 337 B |
Before Width: | Height: | Size: 495 B After Width: | Height: | Size: 495 B |
Before Width: | Height: | Size: 737 B After Width: | Height: | Size: 737 B |
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 725 B |
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 539 B |
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 666 B After Width: | Height: | Size: 666 B |
Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 389 B |
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 974 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 610 B |
Before Width: | Height: | Size: 555 B After Width: | Height: | Size: 555 B |
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 662 B After Width: | Height: | Size: 662 B |
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 504 B |
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 589 B After Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 508 B |
Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 356 B |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 442 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 616 B After Width: | Height: | Size: 616 B |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
@ -20,11 +20,8 @@ func (app *Application) full_save_tweet_trove(trove TweetTrove) {
|
|||||||
updated_user, err := scraper.GetUserByID(u_id)
|
updated_user, err := scraper.GetUserByID(u_id)
|
||||||
if errors.Is(err, scraper.ErrDoesntExist) {
|
if errors.Is(err, scraper.ErrDoesntExist) {
|
||||||
// Mark them as deleted.
|
// Mark them as deleted.
|
||||||
// Handle and display name won't be clobbered if the user exists.
|
// Handle and display name won't be updated if the user exists.
|
||||||
updated_user = User{ID: u_id, DisplayName: "<Unknown User>", Handle: "<UNKNOWN USER>", IsDeleted: true}
|
updated_user = User{ID: u_id, DisplayName: "<Unknown User>", Handle: "<UNKNOWN USER>", IsDeleted: true}
|
||||||
} else if errors.Is(err, scraper.ErrUserIsBanned) {
|
|
||||||
// Mark them as banned (also won't clobber handle and display name)
|
|
||||||
updated_user = User{ID: u_id, DisplayName: "<Unknown User>", Handle: "<UNKNOWN USER>", IsBanned: true}
|
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
panic(fmt.Errorf("error scraping conflicting user (ID %d): %w", u_id, err))
|
panic(fmt.Errorf("error scraping conflicting user (ID %d): %w", u_id, err))
|
||||||
}
|
}
|