-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
18,102 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"log" | ||
"os" | ||
) | ||
|
||
func main() { | ||
fmt.Printf("Reading %s", os.Args[1]) | ||
f, err := os.ReadFile(os.Args[1]) | ||
if err != nil { | ||
log.Fatal("cannot read file: %v", err) | ||
} | ||
|
||
var c albumImagesResponse | ||
|
||
if err := json.Unmarshal(f, &c); err != nil { | ||
log.Fatalf("cannot unmarshal: %v", err) | ||
} | ||
|
||
log.Printf("%+v", c) | ||
} | ||
|
||
type albumImagesResponse struct { | ||
Response struct { | ||
URI string `json:"Uri"` | ||
AlbumImage []albumImage `json:"AlbumImage"` | ||
Pages struct { | ||
NextPage string `json:"NextPage"` | ||
} `json:"Pages"` | ||
} `json:"Response"` | ||
} | ||
|
||
type albumImage struct { | ||
AlbumPath string // From album.URLPath | ||
FileName string `json:"FileName"` | ||
ImageKey string `json:"ImageKey"` // Use as unique ID if FileName is empty | ||
ArchivedMD5 string `json:"ArchivedMD5"` | ||
ArchivedSize int64 `json:"ArchivedSize"` | ||
ArchivedUri string `json:"ArchivedUri"` | ||
IsVideo bool `json:"IsVideo"` | ||
Processing bool `json:"Processing"` | ||
UploadKey string `json:"UploadKey"` | ||
DateTimeOriginal string `json:"DateTimeOriginal"` | ||
Caption string `json:"Caption"` | ||
DateTimeUploaded string `json:"DateTimeUploaded"` | ||
Keywords string `json:"Keywords"` | ||
Latitude string `json:"Latitude"` | ||
Longitude string `json:"Longitude"` | ||
Status string `json:"Status"` | ||
SubStatus string `json:"SubStatus"` | ||
Uris struct { | ||
ImageMetadata struct { | ||
Uri string `json:"Uri"` | ||
} `json:"ImageMetadata"` | ||
LargestVideo struct { | ||
Uri string `json:"Uri"` | ||
} `json:"LargestVideo"` | ||
Components struct { | ||
Uri string `json:"Uri"` | ||
} `json:"Components"` | ||
} `json:"Uris"` | ||
|
||
builtFilename string // The final filename, after template replacements | ||
} |
Oops, something went wrong.