Ngithole ulwazi lohlelo lokusebenza lwe-Reddit lwe-iOS lungcono kunenguqulo yewebhu, ngakho-ke ngicabange ukubheka ukuthi ilayisha kanjani idatha ngokushesha okungaka. Nakhu ukuchithwa kohlelo lokusebenza lwe-Reddit's iOS.
Nakhu okugqamile:
Nakhu ukuchithwa okuningiliziwe kwamakholi we-API. Ngisebenzise Uhlelo Lokusebenza Lwedeskithophu Yesicelo ukuze ngibambe uhlelo lokusebenza lwe-iOS ye-Reddit, imiyalelo yokusetha inikezwa lapha .
I-Reddit App idalwe nayo
Umbuzo omkhulu enganginawo ukuthi uhlelo lokusebenza lusebenza kanjani ngokushesha okungaka uphendulwe lapho kuhlolwa impendulo ye -FeedPostDetailsByIds API. Le API ibizwa esikrinini sasekhaya ngama-id wokuthunyelwe abonisiwe futhi iza nolwazi oluningiliziwe oluboniswa ngemva kokuchofoza okuthunyelwe. Lokhu kulayishwa kuqala kokuthunyelwe okuphezulu kusize ekuboniseni ngokushesha isikrini semininingwane yokuthunyelwe ngaphandle kwanoma yisiphi isilayishi.
Imibuzo ye-GraphQL iqukethe idatha nesakhiwo sempendulo edingekayo. Igama lomsebenzi ngokuvamile uyazikhethela. Ama-API amaningi e-Reddit anamagama okusebenza kuphela emibuzweni futhi okuguquguqukayo kutholakala kuphela uma kukhona okuguquguqukayo okukusikrini/izihlungi ezifana nokuphakelayo okunezinketho zokuthunyelwe ezishisayo nezakamuva.
Lokhu kunikeza ukulawula okuncane kubathuthukisi abaphambili ukwenza izinguquko ngokuzimele kodwa ukulawula okwengeziwe ekusebenziseni kabi ama-API ukuze balande idatha engadingekile ngemva kwayo yonke i-API ebheke kumsebenzisi.
Ukwenza izivivinyo kuzinhlelo zokusebenza zomdabu ze-iOS kunzima kudinga ukuphinda kusetshenziswe ukuze kunikwe amandla noma ukukhubaza ukuhlola, kodwa i-Reddit isethe uhlelo lokusebenza ngendlela yokuthi izivivinyo zingalawulwa ukude. Zonke izivivinyo zilayishwa ku-API kanye namanani azo kanye nezimo. Uhlelo lokusebenza luvula ngokuzenzakalelayo ukwahluka kokuhlolwa elikunikezile.
Ngabasebenzisi abaningi kangaka, ukuhlolwa nezici kungcono ukuzilawula ukude. I-Reddit yenza umsebenzi omuhle kakhulu wokulawula lezi zici ukude.
Njalo lapho kwethulwa uhlelo lokusebenza, izobiza i-API yokumisa ukuze ilayishe okuguquguqukayo kokucushwa okungu-400+. Ngokusekelwe kulokhu okuguquguqukayo ibonisa izici ezihlukene nokuhlukahluka kwezici.
I-API enegama lokusebenza GetTopKarmaSubreddits
ithola uhlu lwama-subreddits aphezulu anamaphuzu e-karma atholwe kokukodwa. Le API iveza ukuthi mangaki amazwana kanye ne-karma yokuthunyelwe esikuzuzile emsebenzini wethu ku-sub-reddit ngayinye. Angikwazanga ukuthola lolu lwazi ngaphakathi kwewebhu ye-Reddit kanye ne-UI yeselula.
Ngenkathi ngifunda ama-API ukuze ngithole ukuthi iletha luphi uhlobo lwedatha, ngithole SubredditFeedElements
API ilayisha okuphakelayo kwe-sub-reddit ekhethiwe kodwa ngokuthunyelwe ngakunye, ine-JSON ehlanganisiwe yolwazi oluncane lwe-reddit. Lolu lwazi alunalutho futhi lungasuswa ukuze kwehliswe umthwalo wenethiwekhi we-API futhi kuthuthukiswe ukusebenza kwayo.
Qaphela: I SubredditFeedElements
API manje isithathelwe indawo yi SubredditFeedSdui
API futhi inkinga isilungisiwe.
Ngizamile ukusebenzisa i-ChatGPT ukuze ngithole imininingwane ethile kuma-API. Ngakho-ke dala ifayela elinawo wonke ama-API ane-curl yawo kanye nezimpendulo zawo kuwo. Kulayishwe leli fayela ku-CustomGPT ukuze ngikwazi ukubeka noma yiluphi uhlobo lombuzo. Inikeze imininingwane ethile ebibonakala njengokuthi hlobo luni lokusetshenziswa i-API engase ibe nalo kanye nesakhiwo sempendulo kodwa yahlohla kakhulu, cishe ngenxa yama-API amaningi noma angiyena uchwepheshe wokwazisa. Eminye yemibono enikezwe i-AI:
GetAllExperimentVariants
API — Ukuhlola okuningi kunamagama athile "okuhlukile", okuhlanganisa izinketho ezifana enabled
, variant_1
, control_model
, kanye ne one_feed_ph_bridge_new_users
. Lesi sigaba siphakamisa ukuthi i-Reddit ihlola izici kumasegimenti athile wabasebenzisi ukuze kutholwe umthelela wazo. Isibonelo, isilingo esithi d2x_avatar_in_comments_loggedin
sinokuhlukahluka okubili, loggedin
, nokuphuma loggedout
, okungase kuhlole isici ngokusekelwe esimweni sokuqinisekisa somsebenzisi.GetAllExperimentVariants
API — Ukuhlola kuhlanganisa hybrid_video_rollout_android_v2
, active_sales
, kanye ne gql_google_maps_integration
, ekhomba inhlobonhlobo yokuhlolwa kwezici ezihlanganisa ukusebenza kwevidiyo, ukubekwa kwezikhangiso, ukuthuthukiswa kokusetshenziswa kubonwa, kanye nokuhlanganisa okuvela eceleni.GetAccountDetails
API — Impendulo ye-API iqukethe izinkambu ezihlukahlukene ezichaza isimo se-akhawunti yomsebenzisi, njenge isSubredditCreationAllowed
, isNameEditable
, isPasswordSet
, kanye nesimo somongameli somsebenzisi. Ukwengeza, kuhlanganisa suspensionExpiresAt
kanye isSuspended
, okubonisa ukuthi i-akhawunti okwamanje imisiwe noma ivinjelwe.Kukhona uhlu lwama-GraphQL APIs engiwafunde ukuze ngiqonde ukuthi iReddit isebenza kanjani. Bekukhona amanye ama-API anjengokufakazela ubuqiniso, ukubika njll. Angizange ngiwafake kulolu hlu.
Isikrini | I-GraphQL API | Incazelo |
---|---|---|
Ikhaya | GetAllDynamicConfigs | Ilayisha amapharamitha angu-400+ asekelwe ekutheni yiziphi izici zohlelo lokusebenza ezisebenzayo. Ukulungiselelwa kukufomethi yenani lokhiye elivamile kanye nohlobo lwenani okungaba i-JSON, i-float, iyunithi yezinhlamvu njll. |
| GetAllExperimentVarians | Isicelo siqukethe ulwazi olumayelana nohlelo lokusebenza nedivayisi ezonikezwa ukuhlolwa okuhloselwe idivayisi nenguqulo yohlelo lokusebenza. Impendulo iqukethe uhlu lwazo zonke izivivinyo ezine-id, i-experimentName, inguqulo nesimo. |
| GetAccount | Ilayisha yonke imininingwane yomsebenzisi ongene ngemvume. |
| IkhayaFeedSdui | Ilayisha amaposi ambalwa okuqala anemininingwane encane engaboniswa ekhasini eliyisiqalo. |
| I-FeedPostDetailsByIds | Ilayisha kuqala okuthunyelwe kusetshenziswa ama-id anayo yonke imininingwane, uma kwenzeka umsebenzisi achofoza okuthunyelwe. |
| I-DiscoverBarRecommendations | Zitholele idatha yebha. |
| UserPremiumSubscription | Idatha ehlobene nokubhaliselwe kwe-premium yomsebenzisi |
| I-GetUserAdEligibility | Ithola ukufaneleka kwesikhangiso somsebenzisi nanoma yiziphi izintandokazi. |
| Ama-BadgeCounts | Ulwazi mayelana namabheji atholwe umsebenzisi. |
| | |
Ikhasi le-Subreddit | SubredditChannels | Ilayisha yonke imininingwane eyisisekelo mayelana nomphakathi njengencazelo, izithonjana, izinto zokubala, izinhlobo zokuthunyelwe ezivunyelwe, nemibala. |
| SubredditTaxonomyTopics | Ilayisha isigaba somphakathi kanye nombhalo obonisiwe njengokuthi uma ngilayisha umphakathi r/software uzobonisa #20 ku-Software & Apps. |
| IsInvitePending | Njengoba igama liphakamisa hlola isimemo esilindile, kodwa ungaqiniseki ukuthi yisiphi isimemo. |
| SubredditChannels | Ilayisha iziteshi zengxoxo ze-sub-reddit, ngibheke ama-subreddits amaningi kodwa angiwatholanga. |
| I-blockedRedditors | Iletha idatha uma umsebenzisi evinjiwe. |
| Thola amaModerators | Ithola uhlu lwamamodeli. |
| I-FetchStructuredStyleAndWidgets | Le API iletha ulwazi mayelana nesitayela, imithetho kanye nemininingwane yomphakathi. |
| Izincomo Zomphakathi Ezihlobene | Le API iletha imiphakathi ehlobene. |
| I-SubredditMuting | Ihlola ukuthi i-subreddit ithulisiwe yini. |
| I-SubredditFeedElements | Ilayisha okuphakelayo kwe-sub-reddit. Kudingeka izihlungi nezinketho zesakhiwo ezikhethelwe i-sub-reddit. Iletha yonke imininingwane mayelana nokuthunyelwe okumele kuboniswe kokuphakelayo. |
| I-PostInfoByIdComments | Lesi sicelo silayisha kuqala amazwana wokuthunyelwe kokuqala kuphela. |
| | |
Thumela Ikhasi | I-GetCustomEmojisStatus | Le API ibizwe nge-id ye-sub-reddit futhi ilayisha isimo sama-emoji angokwezifiso ku-sub-reddit. Akucaci kahle ukuthi kungani le API ibizwa, kodwa ngiyibonile izikhathi eziningi. Impendulo |
| I-GetSubredditAchievementFlairsStatus | Ngokufanayo nesimo se-emoji kuthatha i-sub-reddit id futhi ithola impendulo njengeVunyiwe: amanga . Inhloso yalokhu ayikangicaceli. |
| I-PostInfoByIdComments | Le API isetshenziselwa ukulayisha amazwana wokuthunyelwe ngokusebenzisa i-id yokuthunyelwe ephasiswe esicelweni. |
| AmazwanaPageAds | Ilayisha isikhangiso ngenhla nje kwamazwana. |
| | |
Ikhasi Lephrofayela | I-RedditorByName | Ilayisha imininingwane yephrofayili yomsebenzisi ongene ngemvume. |
| I-PostSetSettings | Inombolo yokuthunyelwe okuzolayishwa. |
| I-GetTopKarmaSubreddits | Thola uhlu lwama-subreddits aphezulu anamaphuzu e-karma emphakathini ngamunye, le API iveza ukuthi mangaki amazwana kanye ne-karma yokuthumela esikuzuzile emsebenzini wethu ku-sub-reddit ngayinye. |
| UserProfileFeed | Isiphakeli sephrofayela yomsebenzisi esiqukethe amazwana nokuthunyelwe. |
| UserPublicTrophies | Uhlu lwezimpumelelo nezindondo ezizuzwe ngegama lomsebenzisi elidluliselwe esicelweni nge-id, igama nesithombe okufanele siboniswe. |
| I-TippingProfileMigrated | Imininingwane mayelana nephrofayili yokunikeza izeluleko, awukasebenzisi lesi sici kakhulu. Kubonise ibhalansi engu-0 kuphrofayela yami 😄. |
Ngingathanda ukwenza amaphuzu ambalwa ekuphetheni kwalesi sivivinyo sokudiliza.