crawlerApp/githubCrawler/models.py
2022-02-06 02:35:04 +05:00

22 lines
No EOL
843 B
Python

from django.db import models
# Create your models here.
class GithubCrawler(models.Model):
url = models.CharField(max_length=1000,blank = False)
api_url = models.CharField(max_length=1000, null= True)
last_pushed = models.DateTimeField(null= True)
last_updated = models.DateTimeField(null= True)
def __str__(self):
return self.url
def save(self, *args, **kwargs):
split_string = self.url.split("/")
self.api_url = 'https://hub.docker.com/v2/repositories/' + split_string[5] +'/' \
+ split_string[6] + '/tags/?page=1&page_size=800'
super(GithubCrawler, self).save(*args, **kwargs)
# Research , via Chrome dev tools ;)
#https://hub.docker.com/r/vectorim/element-web/tags
#https://hub.docker.com/v2/repositories/vectorim/element-web/tags/?page=1&page_size=800