diff --git a/RERUN.sqbpro b/RERUN.sqbpro index e6998ce..0134308 100644 --- a/RERUN.sqbpro +++ b/RERUN.sqbpro @@ -1,100 +1,109 @@ -
UPDATE Posts -SET HasNotesGathered = 0 -WHERE (BlogName, PostID) IN ( - SELECT p.BlogName, p.PostID - FROM Posts p - WHERE p.HasNotesGathered = 1 - AND P.notesGatheredDatetime < 1774294520 - AND EXISTS ( - SELECT 1 - FROM Notes n - WHERE n.PostID = p.PostID - AND n.RootBlogName = p.BlogName - --AND n.Type NOT IN ('reblog', 'reply') - ) - ORDER BY P.PostDate ASC - --LIMIT 500 -);select * -from Blogs ---update blogs set HasBeenOutput = 1 -where HasBeenOutput = 0 -AND -blogname in -( -'teaberrybee', -'reddevilgoddesstoo', -'waywardog13', -'wzjustbrowsing-blog', -'lewerta', -'nudenymph', -'caylachief' - -)select P.slug, N.replyText, n.RootBlogName, n.PostID, NoteBlogName || '.tumblr.com' as NoteBlogName, DatetimeCrawled, TimeStamp, type, n.RootBlogName || '.tumblr.com/post/' || n.postid, datetime(timestamp, 'unixepoch') -from Notes N inner join Posts P on p.PostID = n.PostID -where -DatetimeCrawled > '2026-08-07 11:47:22' and type like 'r%' -and P.IsActive = 1 -order by n.DatetimeCrawledSELECT distinct - '''' || blogname || ''',', - blogs.* - , blogname || '.tumblr.com' -FROM - Blogs - inner JOIN - Notes on notes.noteBlogName = blogs.BlogName -WHERE - HasBeenOutput = 0 and type = 'reblog' -order by - Notes.Type desc, - DateAdded desc -LIMIT 100;WITH ReplyCounts AS ( - SELECT - NoteBlogName, - COUNT(DISTINCT replyText) AS DistinctReplyCount - FROM Notes - where replyText <> '.' - GROUP BY NoteBlogName -) -SELECT - n.RootBlogName || '.tumblr.com/post/' || n.PostID AS PostURL, postid, - n.NoteBlogName, - n.replyText, - c.DistinctReplyCount -FROM Notes n -JOIN ReplyCounts c ON n.NoteBlogName = c.NoteBlogName -where replyText <> '.' and type <> 'reply' ---AND N.NoteBlogName NOT IN ( 'roadblocker21', 'thesaddemon666', 'edwardabbeyhoffman', 'tattedsoldier20', 'zomb-eh', 'animalistic13', 'indken', 'maccloud1592', ---'moss-wizard', 'supertrucker12682', 'exploringthrupics', 'padeyepete' ) -order by c.DistinctReplyCount desc, n.NoteBlogName, n.DateModified desc, replyText, RootBlogName, PostIDWITH PostsWithCount AS ( SELECT P.BlogName, P.PostID, 1925013599 AS LatestNoteTimestamp, P.NotesGatheredDateTime, COUNT(P.PostID) OVER(PARTITION BY P.BlogName) AS CNT, P.HasNotesGathered, P.NotFound, P.PostDate FROM Posts P WHERE COALESCE(P.IsActive, 1) = 1 ), Unioned AS ( SELECT BlogName, PostID, LatestNoteTimestamp, NotesGatheredDateTime, CNT, PostDate FROM PostsWithCount WHERE NotFound = 0 AND HasNotesGathered = 0 UNION SELECT BlogName, PostID, LatestNoteTimestamp, NotesGatheredDateTime, CNT, PostDate FROM PostsWithCount WHERE BlogName = 'zomb-eh' AND NotFound = 0 AND NotesGatheredDateTime < unixepoch('now', 'localtime', '-3 days') ) SELECT U.BlogName, U.PostID, U.LatestNoteTimestamp, U.NotesGatheredDateTime, U.CNT FROM Unioned U WHERE (U.NotesGatheredDateTime < 1786134037 OR U.NotesGatheredDateTime IS NULL) ORDER BY U.NotesGatheredDateTime, U.PostDate DESC, U.BlogName, U.PostID;delete from posts where postid in -( -'741662499571728384', -178892849664, -178264721139, -177012868749, -169950081964, -755440787056099328 -)select * --- delete -from notes -where postid not in (select distinct postid from posts where IsActive = 1)SELECT - * -FROM - POSTS P -WHERE - P.ByLikes = 1 - AND - P.DateCreated > '2026-05-26 17:47:32' -ORDER BY - P.DateCreated descupdate posts set IsActive = 0 where blogname IN ( 'shoebiedoo', 'redheaded-girlygirl', 'xlittle-ghost' )update Posts -set IsActive = 0 -where postid in -( - - -'731937314675310592' - - - -) - -
+
UPDATE Posts +SET HasNotesGathered = 0 +WHERE (BlogName, PostID) IN ( + SELECT p.BlogName, p.PostID + FROM Posts p + WHERE p.HasNotesGathered = 1 + AND P.notesGatheredDatetime < 1774294520 + AND EXISTS ( + SELECT 1 + FROM Notes n + WHERE n.PostID = p.PostID + AND n.RootBlogId = (SELECT BlogId FROM BlogNames WHERE BlogName = p.BlogName) + --AND n.TypeId NOT IN (SELECT TypeId FROM NoteTypes WHERE Type IN ('reblog', 'reply')) + ) + ORDER BY P.PostDate ASC + --LIMIT 500 +);select * +from Blogs +--update blogs set HasBeenOutput = 1 +where HasBeenOutput = 0 +AND +blogname in +( +'teaberrybee', +'reddevilgoddesstoo', +'waywardog13', +'wzjustbrowsing-blog', +'lewerta', +'nudenymph', +'caylachief' + +)select P.slug, N.replyText, rbn.BlogName as RootBlogName, n.PostID, nbn.BlogName || '.tumblr.com' as NoteBlogName, DatetimeCrawled, TimeStamp, nt.Type, rbn.BlogName || '.tumblr.com/post/' || n.postid, datetime(timestamp, 'unixepoch') +from Notes N +inner join Posts P on p.PostID = n.PostID +inner join BlogNames rbn on rbn.BlogId = n.RootBlogId +inner join BlogNames nbn on nbn.BlogId = n.NoteBlogId +inner join NoteTypes nt on nt.TypeId = n.TypeId +where +DatetimeCrawled > '2026-08-07 11:47:22' and nt.Type like 'r%' +and P.IsActive = 1 +order by n.DatetimeCrawledSELECT distinct + '''' || blogname || ''',', + blogs.* + , blogname || '.tumblr.com' +FROM + Blogs + inner JOIN + Notes on notes.noteBlogId = blogs.BlogId + inner JOIN + NoteTypes on NoteTypes.TypeId = Notes.TypeId +WHERE + HasBeenOutput = 0 and NoteTypes.Type = 'reblog' +order by + NoteTypes.Type desc, + DateAdded desc +LIMIT 100;WITH ReplyCounts AS ( + SELECT + NoteBlogId, + COUNT(DISTINCT replyText) AS DistinctReplyCount + FROM Notes + where replyText <> '.' + GROUP BY NoteBlogId +) +SELECT + rbn.BlogName || '.tumblr.com/post/' || n.PostID AS PostURL, postid, + nbn.BlogName AS NoteBlogName, + n.replyText, + c.DistinctReplyCount +FROM Notes n +JOIN ReplyCounts c ON n.NoteBlogId = c.NoteBlogId +JOIN BlogNames rbn ON rbn.BlogId = n.RootBlogId +JOIN BlogNames nbn ON nbn.BlogId = n.NoteBlogId +JOIN NoteTypes t ON t.TypeId = n.TypeId +where replyText <> '.' and t.Type <> 'reply' +--AND nbn.BlogName NOT IN ( 'roadblocker21', 'thesaddemon666', 'edwardabbeyhoffman', 'tattedsoldier20', 'zomb-eh', 'animalistic13', 'indken', 'maccloud1592', +--'moss-wizard', 'supertrucker12682', 'exploringthrupics', 'padeyepete' ) +order by c.DistinctReplyCount desc, nbn.BlogName, n.DateModified desc, replyText, rbn.BlogName, PostIDWITH PostsWithCount AS ( SELECT P.BlogName, P.PostID, 1925013599 AS LatestNoteTimestamp, P.NotesGatheredDateTime, COUNT(P.PostID) OVER(PARTITION BY P.BlogName) AS CNT, P.HasNotesGathered, P.NotFound, P.PostDate FROM Posts P WHERE COALESCE(P.IsActive, 1) = 1 ), Unioned AS ( SELECT BlogName, PostID, LatestNoteTimestamp, NotesGatheredDateTime, CNT, PostDate FROM PostsWithCount WHERE NotFound = 0 AND HasNotesGathered = 0 UNION SELECT BlogName, PostID, LatestNoteTimestamp, NotesGatheredDateTime, CNT, PostDate FROM PostsWithCount WHERE BlogName = 'zomb-eh' AND NotFound = 0 AND NotesGatheredDateTime < unixepoch('now', 'localtime', '-3 days') ) SELECT U.BlogName, U.PostID, U.LatestNoteTimestamp, U.NotesGatheredDateTime, U.CNT FROM Unioned U WHERE (U.NotesGatheredDateTime < 1786134037 OR U.NotesGatheredDateTime IS NULL) ORDER BY U.NotesGatheredDateTime, U.PostDate DESC, U.BlogName, U.PostID;delete from posts where postid in +( +'741662499571728384', +178892849664, +178264721139, +177012868749, +169950081964, +755440787056099328 +)select * +-- delete +from notes +where postid not in (select distinct postid from posts where IsActive = 1)SELECT + * +FROM + POSTS P +WHERE + P.ByLikes = 1 + AND + P.DateCreated > '2026-05-26 17:47:32' +ORDER BY + P.DateCreated descupdate posts set IsActive = 0 where blogname IN ( 'shoebiedoo', 'redheaded-girlygirl', 'xlittle-ghost' )update Posts +set IsActive = 0 +where postid in +( + + +'731937314675310592' + + + +) + +
diff --git a/TL.sqbpro b/TL.sqbpro index 97d714f..8d0d93d 100644 --- a/TL.sqbpro +++ b/TL.sqbpro @@ -1,24 +1,30 @@ -SELECT - BlogName || '.tumblr.com/post/' || postID, - - datetime(NotesGatheredDateTime, 'unixepoch'), * -FROM - Posts -WHERE - NotesGatheredDateTime <> 0 -ORDER BY - postdate descSELECT - datetime(TimeStamp, 'unixepoch'), - RootBlogName || '.tumblr.com/post/' || N.postid, - *, - NoteBlogName || '.tumblr.com' -FROM - Notes N - inner JOIN - Posts P on P.PostID = N.PostID and P.BlogName = N.RootBlogName -WHERE RootBlogName NOT IN ('xlittle-ghost', 'glimmerin-darlin', 'vvenus-child') - and type like 'r%' - and RootBlogName = 'zomb-eh' - and P.HasImage = 1 -ORDER BY - TimeStamp desc +
SELECT + BlogName || '.tumblr.com/post/' || postID, + + datetime(NotesGatheredDateTime, 'unixepoch'), * +FROM + Posts +WHERE + NotesGatheredDateTime <> 0 +ORDER BY + postdate descSELECT + datetime(TimeStamp, 'unixepoch'), + rbn.BlogName || '.tumblr.com/post/' || N.postid, + *, + nbn.BlogName || '.tumblr.com' +FROM + Notes N + inner JOIN + BlogNames rbn on rbn.BlogId = N.RootBlogId + inner JOIN + BlogNames nbn on nbn.BlogId = N.NoteBlogId + inner JOIN + NoteTypes t on t.TypeId = N.TypeId + inner JOIN + Posts P on P.PostID = N.PostID and P.BlogName = rbn.BlogName +WHERE rbn.BlogName NOT IN ('xlittle-ghost', 'glimmerin-darlin', 'vvenus-child') + and t.Type like 'r%' + and rbn.BlogName = 'zomb-eh' + and P.HasImage = 1 +ORDER BY + TimeStamp desc