eeeeeeeeeeeee

This commit is contained in:
GZod01 2024-05-18 19:43:49 +02:00
parent 51aafecb8f
commit a8d427f230
2 changed files with 74 additions and 34 deletions

48
index.gzodp Normal file
View file

@ -0,0 +1,48 @@
<?php
$opts = [
"http" => [
"method" => "GET",
"header" => "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
]
];
$context = stream_context_create($opts);
$u = "https://www.instagram.com/graphql/query/?query_hash=e769aa130647d2354c40ea6a439bfc08&variables=%7B%22id%22%3A%225408546825%22,%20%22first%22%3A%2250%22,%20%22after%22%3A%20%22%22%7D";
$json = file_get_contents($u, false, $context);
$data = json_decode($json, true);
$raw = $data['data']['user']['edge_owner_to_timeline_media']['edges'];
$medias = [];
foreach ($raw as $rawMedia) {
$rawMedia = $rawMedia['node'];
$caption = NULL;
if (count($rawMedia['edge_media_to_caption']['edges']) > 0) {
$caption = $rawMedia['edge_media_to_caption']['edges'][0]['node']['text'];
}
$medias[] = [
'id' => $rawMedia['id'],
'caption' => $caption,
'thumbnail' => $rawMedia['thumbnail_src'],
'original' => $rawMedia['display_url'],
'link' => 'https://www.instagram.com/p/' . $rawMedia['shortcode'] . '/',
'taken_at' => $rawMedia['taken_at_timestamp']
];
}
?>
<div
class="photos-list-photos">
<?php
foreach($medias as $m){
?>
<a
style="background-image:url(<?=$m["thumbnail"]?>);"
title="<?=$m["caption"]?>"
class="photos-list-item"
href="<?=$m["link"]?>"
target="_blank"
>
</a>
<?php
}
?>
</div>

View file

@ -1,34 +1,26 @@
{{ $photos := (resources.Match "posts/*")}} {{/*resources.ByType "image" */}} <div id=photoslist class="transition-parent photos-list">
<div class="transition-parent photos-list"> <div
{{ if (or (eq $photos nil) (eq (len $photos) 0))}} class="transition-child section-error-container"
<div style="height: 100%;">
class="transition-child section-error-container" <div class="section-error-content">
style="height: 100%;"> <i class="fa fas fa-times-circle"></i>
<div class="section-error-content"> {{ .Site.Params.photos.empty }}
<i class="fa fas fa-times-circle"></i> </div>
{{ .Site.Params.photos.empty }} </div>
</div> </div>
</div> <script>
{{ else }} function loadimages(){
<div var http = new XMLHttpRequest();
class="photos-list-photos"> var url = '/getallphotos';
{{ range $photos }} http.open('GET', url, false);
<a http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
style="background-image:url({{ .RelPermalink }});" http.onreadystatechange = function() {//Call a function when the state changes.
title="{{ .Name }}" if(http.readyState == 4 && http.status == 200) {
class="photos-list-item" let responsehtml = http.responseText;
href="{{ .RelPermalink }}" document.querySelector("#photoslist").innerHTML = responsehtml;
target="_blank" }
>
</a> }
{{ end }} http.send();
</div> }
{{ end }} </script>
<no-ssr>
<vue-gallery-slideshow
:images="photosSlideShow"
:index="index"
@close="index = null"
></vue-gallery-slideshow>
</no-ssr>
</div>