this repo has no description
0
fork

Configure Feed

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

archive_app import for app.js

+23 -1
+6
tests/test_import.py
··· 29 29 assert { 30 30 "account-suspension.js", 31 31 "account.js", 32 + "app.js", 32 33 "saved-search.js", 33 34 "following.js", 34 35 "follower.js", ··· 74 75 "archive_follower", 75 76 "archive_saved_search", 76 77 "archive_account", 78 + "archive_app", 77 79 "archive_following", 78 80 } == set(db.table_names()) 79 81 ··· 82 84 ) 83 85 assert [{"accountId": "547842573"}, {"accountId": "12158"}] == list( 84 86 db["archive_following"].rows 87 + ) 88 + 89 + assert [{"appId": "1380676511", "appNames": '["BBC Sounds"]'}] == list( 90 + db["archive_app"].rows 85 91 ) 86 92 87 93 assert [
+10
tests/zip_contents/app.js
··· 1 + window.YTD.app.part0 = [ 2 + { 3 + "app" : { 4 + "appId" : "1380676511", 5 + "appNames" : [ 6 + "BBC Sounds" 7 + ] 8 + } 9 + } 10 + ]
+7 -1
twitter_to_sqlite/archive.py
··· 7 7 # of tables that should be created {"tabe": [rows-to-upsert]} 8 8 transformers = {} 9 9 10 + # These files are deliberately ignored 11 + IGNORE = {"manifest"} 12 + 10 13 11 14 def register(filename, each, pk=None): 12 15 def callback(data): ··· 87 90 def ageinfo(item): 88 91 return item["ageMeta"]["ageInfo"] 89 92 93 + 94 + register("app", each="app", pk="appId") 90 95 91 96 register("block", each="blocking", pk="accountId") 92 97 register("connected-applications", each="connectedApplication", pk="id") ··· 226 231 existing_tables = set(db.table_names()) 227 232 filename = filename[: -len(".js")] 228 233 if filename not in transformers: 229 - print("{}: not yet implemented".format(filename)) 234 + if filename not in IGNORE: 235 + print("{}: not yet implemented".format(filename)) 230 236 return 231 237 transformer, pk = transformers.get(filename) 232 238 data = extract_json(content)