{"id":16227441,"url":"https://github.com/simonaco/redditifier","last_synced_at":"2025-03-19T13:31:05.007Z","repository":{"id":50065834,"uuid":"179830835","full_name":"simonaco/redditifier","owner":"simonaco","description":"Serverless Http endpoint that submits links to the reddit API","archived":false,"fork":false,"pushed_at":"2021-06-05T05:02:21.000Z","size":13,"stargazers_count":5,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T19:31:06.968Z","etag":null,"topics":["azure","azure-functions","nodejs","reddit-api","serverless"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonaco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-06T12:30:07.000Z","updated_at":"2024-06-14T05:41:19.000Z","dependencies_parsed_at":"2022-09-19T05:31:38.671Z","dependency_job_id":null,"html_url":"https://github.com/simonaco/redditifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonaco%2Fredditifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonaco%2Fredditifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonaco%2Fredditifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonaco%2Fredditifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonaco","download_url":"https://codeload.github.com/simonaco/redditifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244434762,"owners_count":20452246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-functions","nodejs","reddit-api","serverless"],"created_at":"2024-10-10T12:52:45.156Z","updated_at":"2025-03-19T13:31:04.759Z","avatar_url":"https://github.com/simonaco.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redditifier | [![Build Status](https://dev.azure.com/sicotin/sicotin/_apis/build/status/simonaco.redditifier?branchName=master)](https://dev.azure.com/sicotin/sicotin/_build/latest?definitionId=26\u0026branchName=master\u0026WT.mc_id=redditifier-github-sicotin)\n\n## Deploy resources\n\n[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://portal.azure.com/?WT.mc_id=redditifier-github-sicotin#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fsimonaco%2Fredditifier%2Fmaster%2Fazuredeploy.json)\n\n## Prerequisites\n\n1. A recent version of Node (8+)\n\n1. VS Code: [here](https://code.visualstudio.com/download/?WT.mc_id=redditfier-github-sicotin)\n\n1. Azure Functions CLI: [here](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?WT.mc_id=redditfier-github-sicotin)  \n\n1. Azure Functions Extension for VS Code: [here](https://marketplace.visualstudio.com/items/?WT.mc_id=redditfier-github-sicotin\u0026itemName=ms-azuretools.vscode-azurefunctions)  \n\n1. Azure account: [here](https://azure.microsoft.com/en-us/free/?wt.mc_id=redditfier-github-sicotin)\n\n## How to run this\n\n1. Clone this repository and cd into *serverless*\n\n1. Create *local.settings.json* file and add:\n\n```json\n{\n  \"IsEncrypted\": false,\n  \"Values\": {\n    \"AzureWebJobsStorage\": \"\",\n    \"FUNCTIONS_WORKER_RUNTIME\": \"node\",\n    \"REDDIT_KEY\": \"YOUR-TOKEN-HERE\",\n  }\n}\n```\n\n\u003e Retrieve your Reddit access token by following steps in the *Get Reddit Authorisation token* section.\n\n1. Run ```npm i``` and ```npm start```\n\n1. To test your function, make a POST request to your function's URL [http://localhost:7071/api/submit-link](http://localhost:7071/api/submit-link) with a body that looks like this:\n\n```json\n{\n    \"title\":\"Use this *checklist* to review your application architecture from a *resiliency* standpoint; Application Design, Data Management, Security, Testing \u0026 Deployment\",\n    \"url\":\"https://docs.microsoft.com/azure/architecture/checklist/resiliency?WT.mc_id=redditifier-github-sicotin\",\n    \"sr\":\"/r/AZURE/\"\n}\n```\n\n## Get Reddit Authorisation token\n\nBefore requesting an authorization toked you need to create an application. If you haven't done that already, make sure to follow steps in this [quick start example](https://github.com/reddit-archive/reddit/wiki/OAuth2-Quick-Start-Example).\n\nMake request to [https://www.reddit.com/api/v1/access_token](https://www.reddit.com/api/v1/access_token)\n\nAuthorization: Basic Auth\nUsername: \u003cyour_app_id\u003e\nPassword: \u003cyour_app_secret\u003e\n\nForm Data:\ngrant_type: password\nusername: \u003cyour_reddit_username\u003e\npassword: \u003cyour_reddit_password\u003e\n\nIf all goes well, you should get a response that looks similar to this:\n\n```json\n{\n    \"access_token\": \"1224568486-RCwzdKMP4zdSt6ASetZpYa80qr4\",\n    \"token_type\": \"bearer\",\n    \"expires_in\": 3600,\n    \"scope\": \"*\"\n}\n```\n\n🙋🏼 Happy coding! 🙋🏼\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonaco%2Fredditifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonaco%2Fredditifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonaco%2Fredditifier/lists"}