diff options
| author | Bobby <[email protected]> | 2023-03-27 21:20:38 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-03-27 21:20:38 -0400 |
| commit | be50c68340ee923da97756bb5cf95b6199703c4c (patch) | |
| tree | b482826f0b76510569de07868105bef9d6cc0ca5 /ignis | |
| parent | 4054f27033a35934b87945057f3c6cd74f343db6 (diff) | |
| download | thatcomputerscientist-be50c68340ee923da97756bb5cf95b6199703c4c.tar.xz thatcomputerscientist-be50c68340ee923da97756bb5cf95b6199703c4c.zip | |
Socialify available in fun stuff
Diffstat (limited to 'ignis')
| -rw-r--r-- | ignis/urls.py | 5 | ||||
| -rw-r--r-- | ignis/views.py | 20 |
2 files changed, 24 insertions, 1 deletions
diff --git a/ignis/urls.py b/ignis/urls.py index 9cea0ad2..13cda935 100644 --- a/ignis/urls.py +++ b/ignis/urls.py @@ -9,5 +9,8 @@ urlpatterns = [ path('/image/<post_id>/<image_name>', views.get_image, name='get_image'), path('/cover/<str:repository>', views.cover_image, name='cover_image'), path('/captcha/<str:captcha_string>', views.captcha_image, name='captcha_image'), - path('/screenshot', views.get_screenshot, name='screenshot') + path('/screenshot', views.get_screenshot, name='screenshot'), + path('/socialify', views.socialify, name='socialify'), +# def socialify(request, repo, theme, font, pattern, name, description, language_1, language_2, stargazers, forks, issues, pulls): + ] diff --git a/ignis/views.py b/ignis/views.py index 965e6498..dbf01212 100644 --- a/ignis/views.py +++ b/ignis/views.py @@ -207,3 +207,23 @@ def get_screenshot(request): response['Pragma'] = 'no-cache' response['Expires'] = '0' return response + +def socialify(request): + repo = request.GET.get('repo') + theme = request.GET.get('theme') + font = request.GET.get('font') + pattern = request.GET.get('pattern') + name = request.GET.get('name') + description = request.GET.get('description') + language_1 = request.GET.get('language_1') + language_2 = request.GET.get('language_2') + stargazers = request.GET.get('stargazers') + forks = request.GET.get('forks') + issues = request.GET.get('issues') + pulls = request.GET.get('pulls') + + url = 'https://socialify.thatcomputerscientist.com/{}/png?description={}&font={}&forks={}&issues={}&language={}&language2={}&name={}&owner=1&pattern={}&pulls={}&stargazers={}&theme={}'.format(repo, description, font, forks, issues, language_1, language_2, name, pattern, pulls, stargazers, theme) + + print(url) + image = requests.get(url).content + return HttpResponse(image, content_type='image/png') |
