Don't forget to lycansubscribe 🐺
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

after completed import, only import new likes

+19 -3
+10 -2
app/importer.rb
··· 26 26 import = @user.import || @user.create_import! 27 27 28 28 params = { repo: @did, collection: 'app.bsky.feed.like', limit: 100 } 29 - params[:cursor] = import.cursor if import.cursor 29 + 30 + if import.cursor 31 + params[:cursor] = import.cursor 32 + else 33 + import.update!(started_from: Time.now) 34 + end 30 35 31 36 count = 0 37 + time_limit ||= import.last_completed 38 + 39 + puts "Fetching until: #{time_limit}" if time_limit 32 40 33 41 loop do 34 42 response = @minisky.get_request('com.atproto.repo.listRecords', params) ··· 49 57 break if time_limit && records.any? { |x| Time.parse(x['value']['createdAt']) < time_limit } 50 58 end 51 59 52 - import.update!(cursor: nil) 60 + import.update!(cursor: nil, started_from: nil, last_completed: import.started_from) 53 61 @report&.update(importer: { finished: true }) 54 62 end 55 63
+6
db/migrate/20250831210930_add_import_timestamps.rb
··· 1 + class AddImportTimestamps < ActiveRecord::Migration[7.2] 2 + def change 3 + add_column :imports, :started_from, :datetime 4 + add_column :imports, :last_completed, :datetime 5 + end 6 + end
+3 -1
db/schema.rb
··· 10 10 # 11 11 # It's strongly recommended that you check this file into your version control system. 12 12 13 - ActiveRecord::Schema[7.2].define(version: 2025_08_31_202829) do 13 + ActiveRecord::Schema[7.2].define(version: 2025_08_31_210930) do 14 14 # These are extensions that must be enabled in order to support this database 15 15 enable_extension "plpgsql" 16 16 17 17 create_table "imports", force: :cascade do |t| 18 18 t.integer "user_id", null: false 19 19 t.string "cursor" 20 + t.datetime "started_from" 21 + t.datetime "last_completed" 20 22 t.index ["user_id"], name: "index_imports_on_user_id", unique: true 21 23 end 22 24