ShareShortcuts

9GAG 🐳

9GAG 🐳 Download 9GAG posts Setup 1

oliver
„9GAG 🐳“ forken

Hast du auf Basis dieses Kurzbefehls etwas Neues erstellt? Teile ihn als Fork: Er wird zu deinem eigenen Kurzbefehl, den du selbst verwaltest, und beide Seiten verlinken aufeinander, damit oliver die Anerkennung erhält.

  1. 1Lade den Kurzbefehl und ändere ihn in der Kurzbefehle-App. Gib ihm einen eigenen Namen.
  2. 2Teile ihn in der Kurzbefehle-App und kopiere den iCloud-Link.
  3. 3Komm hierher zurück, füge den Link ein und beschreibe, was sich geändert hat, z. B. „Einen Schritt hinzugefügt, der Apple Intelligence nutzt, um den Text zu personalisieren.“
Downloads
64K
Gesichert
0
Aktionen
121
Kategorie
API
Version
1.0
Sprache
EN

Vorschau

9GAG 🐳

Download 9GAG posts

Setup

  1. Create a photo album called 9 GAG
  2. Edit the popular and sections list
  3. Hit run 🥳

Neue Funktionen

Version 1.0

First release

Versionsverlauf
1.0 1. Dez 2019

First release

Was er macht

121 Aktionen
  1. Dictionary
  2. Set Variable
    config
  3. Get Dictionary Value
  4. Repeat with Each
  5. Get Dictionary Value
  6. Get Type
  7. Get Type
  8. If
  9. Get Dictionary Value
  10. Set Variable
    sub_config
  11. Get Dictionary Value
  12. Repeat with Each
  13. Get Dictionary Value
  14. Set Dictionary Value
  15. Set Variable
    sub_config
  16. Set Dictionary Value
  17. Set Variable
    config
  18. If
  19. Set Dictionary Value
  20. Set Variable
    config
  21. Get Dictionary Value
  22. Set Variable
    backtrack
  23. Get Dictionary Value
  24. Set Variable
    album
  25. Get Dictionary Value
  26. Set Variable
    notification
  27. Get Dictionary Value
  28. Set Variable
    preview
  29. Get Dictionary Value
  30. Set Variable
    save
  31. Get Dictionary Value
  32. If
  33. Text
  34. If
  35. Text
  36. Set Variable
    section_name
  37. Get Dictionary Value
  38. Text
  39. Set Variable
    database.file
  40. Get File
  41. Get Dictionary from Input
  42. Set Variable
    database
  43. Set Variable
    previews
  44. List
  45. Repeat with Each
  46. Get Dictionary Value
  47. Repeat with Each
  48. Set Variable
    section
  49. Get Dictionary Value
  50. If
  51. Number
  52. Set Variable
    downloads
  53. Set Variable
    newest_post
  54. Get Dictionary Value
  55. Set Variable
    last_post
  56. If
  57. Number
  58. Set Variable
    last_post
  59. If
  60. Text
  61. Set Variable
    next
  62. Repeat
  63. Get Contents of URL
    https://9gag.com/v1/group-posts/group/…/type/…?…
  64. Set Variable
    json
  65. Get Dictionary Value
  66. Repeat with Each
  67. Set Variable
    post
  68. Get Dictionary Value
  69. If
  70. Get Dictionary Value
  71. If
  72. Set Variable
    newest_post
  73. If
  74. If
  75. Set Variable
    newest_post
  76. If
  77. If
  78. Get Dictionary Value
  79. If
  80. Get Dictionary Value
  81. If
  82. Get Dictionary Value
  83. Set Variable
    url
  84. Get Contents of URL
    …
  85. Add to Variable
  86. If
  87. Save to Photo Album
  88. If
  89. Calculate
  90. Set Variable
    downloads
  91. If
  92. If
  93. Get Dictionary Value
  94. Set Variable
    next
  95. Set Dictionary Value
  96. Set Variable
    database
  97. If
  98. If
  99. Show Notification
    … neue Beiträge in …
  100. If
  101. If
  102. If
  103. Count
  104. If
  105. Get Dictionary Value
  106. Set Variable
    airplane
  107. If
  108. Set Airplane Mode
  109. If
  110. If
  111. Quick Look
  112. If
  113. If
  114. Set Airplane Mode
  115. If
  116. If
  117. If
  118. Show Notification
    Keine neuen Beiträge
  119. If
  120. Save File
  121. Count

Als Code ansehen
Beta

Jede Aktion dieses Kurzbefehls als Cherri ausgeschrieben, eine Programmiersprache für Kurzbefehle. Ideal, um zu lernen, wie er funktioniert.

#include 'actions/web'
#define color green
#define glyph play

@config = {
	"airplane": false,
	"album": "9 GAG",
	"backtrack": 2,
	"database": "9gag",
	"hot": true,
	"notification": true,
	"popular": {
		"animals": false,
		"anime-manga": false,
		"animewaifu": false,
		"awesome": false,
		"car": false,
		"comic-webtoon": false,
		"cosplay": false,
		"funny": false,
		"gaming": false,
		"gif": false,
		"girl": false,
		"girlcelebrity": false,
		"leagoflegends": false,
		"meme": false,
		"nsfw": false,
		"politics": false,
		"relationship": false,
		"savage": false,
		"video": false,
		"wtf": false
	},
	"preview": false,
	"save": true,
	"sections": {
		"animewallpaper": false,
		"apexlegends": false,
		"ask9gag": false,
		"basketball": false,
		"countryballs": false,
		"crappydesign": false,
		"darkhumor": false,
		"drawing-diy-crafts": false,
		"food-drinks": false,
		"football": false,
		"fortnite": false,
		"got": false,
		"guy": false,
		"history": false,
		"home-living": false,
		"horror": false,
		"kpop": false,
		"lego": false,
		"movie-tv": false,
		"music": false,
		"overwatch": false,
		"pcmr": false,
		"pokemon": false,
		"pubg": false,
		"rate-my-outfit": false,
		"satisfying": false,
		"school": false,
		"science-tech": false,
		"sport": false,
		"starwars": false,
		"superhero": false,
		"timely": false,
		"travel-photography": false,
		"wallpaper": false,
		"warhammer": false,
		"wholesome": false
	}
}
const Wrterbuchwert = getValue(ShortcutInput, "")

for _ in Wrterbuchwert {
	const Wrterbuchwert1 = getValue(ShortcutInput, @RepeatItem)
	const Typ = typeOf(Wrterbuchwert1)
	typeOf(@config)
	if Typ ==  {
		@sub_config = @config[@RepeatItem]
		const Wrterbuchwert2 = getKeys(Wrterbuchwert1)
		for _ in Wrterbuchwert2 {
			setValue(@sub_config, @RepeatItem2)
			@sub_config
		}
		setValue(@config, @RepeatItem, @sub_config)
		@config
	} else {
		setValue(@config, @RepeatItem, Wrterbuchwert1)
		@config
	}
}
@backtrack = @config['backtrack']
@album = @config['album']
@notification = @config['notification']
@preview = @config['preview']
@save = @config['save']
const Wrterbuchwert3 = getValue(@config, "hot")

if Wrterbuchwert3 ==  {
} else {
}
@section_name = "fresh"
@databasefile = "{}.json"
const Datei = getFileFromFolder(, @databasefile, false)
getDictionary(Datei)
@database
@previews = nil
const Liste = list(@config['popular'], @config['sections'])

for _ in Liste {
	const Wrterbuchwert4 = getValue(@RepeatItem, "")
	for _ in Wrterbuchwert4 {
		@section = @RepeatItem2
		const Wrterbuchwert5 = getValue(@RepeatItem, @section)
		if Wrterbuchwert5 ==  {
			@downloads = 0
			@newest_post = nil
			@last_post = @database[@section]
			if !@last_post {
				@last_post = 0
			} else {
			}
			@next = "nil"
			repeat _ for @backtrack {
				downloadURL("https://9gag.com/v1/group-posts/group/{@section}/type/{@section_name}?{@next}")
				@json
				const Wrterbuchwert6 = getValue(@json, "data.posts")
				for _ in Wrterbuchwert6 {
					@post = @RepeatItem4
					const Wrterbuchwert7 = getValue(@post, "article")
					if !Wrterbuchwert7 {
						const Wrterbuchwert8 = getValue(@post, "creationTs")
						if !@newest_post {
							@newest_post = Wrterbuchwert8
						} else {
							if Wrterbuchwert8 > @newest_post {
								@newest_post = Wrterbuchwert8
							} else {
							}
						}
						if Wrterbuchwert8 > @last_post {
							const Wrterbuchwert9 = getValue(@post, "images.image460sv")
							if Wrterbuchwert9 {
								getValue(Wrterbuchwert9, "url")
							} else {
								getValue(@post, "images.image700.url")
							}
							@url
							const InhaltDerURL = downloadURL(@url)
							@previews = InhaltDerURL
							if @save ==  {
								savePhoto(InhaltDerURL, @album)
							} else {
							}
							@downloads = @downloads + 1
						} else {
						}
					} else {
					}
				}
				@next = @json['data.nextCursor']
			}
			setValue(@database, @section, @newest_post)
			@database
			if @downloads > 0 {
				if @notification ==  {
					showNotification("{@downloads} neue Beiträge in {@section}", "9GAG 🐳", @database)
				} else {
				}
			} else {
			}
		} else {
		}
	}
}
const Anzahl = count(@previews)

if Anzahl > 0 {
	@airplane = @config['airplane']
	if @airplane ==  {
		setAirplaneMode(false)
	} else {
	}
	if @preview ==  {
		quicklook(@previews)
	} else {
	}
	if @airplane ==  {
		setAirplaneMode(0)
	} else {
	}
} else {
	if @notification ==  {
		showNotification("Keine neuen Beiträge", "9GAG 🐳", Anzahl)
	} else {
	}
}
saveFile(@databasefile, @database, true)
count(@previews)
In Cherri Playground öffnen Mit cherri 2.3.0 (GPL-2.0) dekompiliert. Eventuell sind kleine Korrekturen nötig, bevor es kompiliert wird.

Bewertungen und Rezensionen

Rezension schreiben
–
von 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Werbung

Mehr von oliver

Alle anzeigen

Das gefällt dir vielleicht auch

Alle anzeigen
Werbung