tinkerbotsict Posted August 10, 2018 Posted August 10, 2018 Hi I am wanting to share a files but I want each individual user I share with to have their own code. Is there a cloud system which day could generate eg 50 links for a file in bulk instead of doing it individual once I shared 1 code? I do have G-Drive but I don’t think that has this feature. Thanks in advance.
mavhc Posted August 10, 2018 Posted August 10, 2018 https://developers.rebrandly.com/v1/docs should work for you, you'd need a script to call the api 50 times, probably just 10 lines of python 1
tinkerbotsict Posted August 10, 2018 Author Posted August 10, 2018 I have no idea how to do this might be a little advanced for me lol
jmak Posted August 10, 2018 Posted August 10, 2018 What is it that you want to achieve? Who are you sharing the file with? It sounds like what Google Classroom was designed to help with - each pupil gets their own copy of a file to work on. But I may be getting the wrong end of the stick [emoji846]
tinkerbotsict Posted August 10, 2018 Author Posted August 10, 2018 No I have another google account that i use. I share resources I make and lesson etc but when I want to share them with people I want them to have their own link. This would help identify when my stuff get shared without me sharing who originally had it.
jmak Posted August 10, 2018 Posted August 10, 2018 To catch people stealing from you! Makes sense. Sorry I couldn't help.
tinkerbotsict Posted August 10, 2018 Author Posted August 10, 2018 Yeah that the basic idea I had but can’t seem to find cloud storage that offers it and if there another way I need to learn how to do it lol
tom_newton Posted August 11, 2018 Posted August 11, 2018 Amazon s3 can do it, but again it's a bit of work to generate the links. Cachefly can make time limited links too
tinkerbotsict Posted August 11, 2018 Author Posted August 11, 2018 Do you know anywhere that shows or explains how to generate them
mavhc Posted August 11, 2018 Posted August 11, 2018 So, sign up for rebrandly, create your own domain if you wish/can do dns, then go to https://app.rebrandly.com/account/api-keys and click New API key It'll give you some random characters, save the code below as ShortLinks.py, then copy and paste the random characters into the first line of this code, between the "s apikey = "" domain = "rebrand.ly" import requests import json def inputNumber(message): while True: try: userInput = int(input(message)) except ValueError: print("Not an integer! Try again.") continue else: return userInput break def createShortURL(destination): r = requests.post("https://api.rebrandly.com/v1/links", data = json.dumps({ "destination": destination , "domain": { "fullName": domain } }), headers={ "Content-type": "application/json", "apikey": apikey }) if (r.status_code == requests.codes.ok): link = r.json() return link["shortUrl"] else: return "Failed" destination = input("Enter the link you wish to shorten: ") numberOfLinks = inputNumber("How many short links do you wish to create? ") for i in range(numberOfLinks): print(createShortURL(destination)) Install Python3, open a cmd window, type: pip install requests It should say something like: Collecting requests Downloading https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda /requests-2.19.1-py2.py3-none-any.whl (91kB) Then double click the ShortLinks.py file, and if you don't have any proxy problems it should work
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now