ShareShortcuts

9GAG 🐳

9GAG 🐳 Download 9GAG posts Setup 1

oliver
Dupliquer « 9GAG 🐳 »

Tu as créé quelque chose de nouveau à partir de ce raccourci ? Partage-le comme version dérivée : il devient un raccourci à toi, que tu gères, et les deux pages renvoient l’une vers l’autre pour que oliver soit crédité.

  1. 1Obtenez le raccourci et modifiez-le dans l’app Raccourcis. Donnez-lui un nom bien à lui.
  2. 2Partage-le depuis l’app Raccourcis et copie le lien iCloud.
  3. 3Reviens ici, colle le lien et décris ce qui change, par exemple : « Ajout d’une étape qui utilise Apple Intelligence pour personnaliser le texte. »
Créer mon fork
Téléchargements
64K
Enregistré
0
Actions
121
Catégorie
API
Version
1.0
Langue
EN

Aperçu

9GAG 🐳

Download 9GAG posts

Setup

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

Nouveautés

Version 1.0

First release

Historique des versions
1.0 1 déc. 2019

First release

Ce qu’il fait

121 actions
  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

Afficher en tant que code
Bêta

Chaque action de ce raccourci écrite en Cherri, un langage de programmation pour Raccourcis. Idéal pour comprendre son fonctionnement.

#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 = getValues(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)
Ouvrir dans Cherri Playground Décompilé avec cherri 2.3.0 (GPL-2.0). Quelques corrections peuvent être nécessaires avant la compilation.

Notes et avis

Écrire un avis
–
sur 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Aucun avis pour le moment. Sois le premier à partager ton avis !

Publicité

Plus de oliver

Tout afficher

Ça pourrait aussi te plaire

Tout afficher
Publicité