Jump to content

Recommended Posts

Posted

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.

Posted

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]

Posted
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.
Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...