Skip to content

Instantly share code, notes, and snippets.

@richardlehane
richardlehane / steffen.go
Created June 11, 2017 01:01
Getting MIME from results
/*
Sorry Steffen, documentation of the siegfried package needs a lot of attention!
Also, I've pretty much just focussed on sf tool's needs without making the package very ergonomic/ easy to use in other contexts.
The reason there is no method to directly access a MIME type is that I've tried to make Identifications as abstract as possible.
I.e. even though the three supported Identifiers (PRONOM, LOC and MIMEInfo) all have a MIME field, it may in future be desirable
to add another Identifier type that doesn't have this information (though I admit that is unlikely!).
The interfaces for Identifier (a set of signatures) and Identification (a result returned by an Identifier) are both defined in
the pkg/core package: http://godoc.org/github.com/richardlehane/siegfried/pkg/core
https://scontent.xx.fbcdn.net/v/t1.0-9/16473861_1331223243672580_3007363330168360217_n.jpg?oh=cd1262c0a6f6c47924cfc9fb04deedc4&oe=5969FB7D
https://scontent.xx.fbcdn.net/v/t31.0-8/16300242_1331221857006052_6101553113289312731_o.jpg?oh=f4c366ac0b45de605b7e556cc7d42d97&oe=594ED382
https://scontent.xx.fbcdn.net/v/t1.0-9/16174697_1322504821211089_3388130383708913956_n.jpg?oh=0d6b146d8260742b13da73dc0a860a7e&oe=596B6696
https://scontent.xx.fbcdn.net/v/t31.0-8/16143844_1319021801559391_1393710172709706700_o.jpg?oh=6f92747d0f11fcb27fcf12d0e57fbdab&oe=5952BCBE
https://scontent.xx.fbcdn.net/v/t1.0-9/15965128_1308346382626933_2423410593828143732_n.jpg?oh=a844d921ac81453e5553bb1da6e5862c&oe=59571B3D
https://scontent.xx.fbcdn.net/v/t1.0-9/15747748_1301113983350173_2648964543649987526_n.jpg?oh=ea2a2575a3374bbab68f4c31c894b2fd&oe=5998ECC0
https://scontent.xx.fbcdn.net/v/t1.0-9/15622307_1295388000589438_2862535887186151727_n.jpg?oh=1b147cbe520af071670a07bcda6df0f3&oe=59980D96
https://scontent.xx.fbcdn.net/v/t1.0-9/15241138_1
[
{
"id": "1322504821211089_1322509094543995",
"created_time": "2017-01-22T23:39:34+0000",
"from": {
"id": "10154110788742563",
"name": "Cinzia Della Corte"
},
"message": "Thank you Mike Baird for everything. All the best to you and your family.",
"comments": [
https://www.facebook.com/mikebairdMP/videos/1318653904929514/
https://www.facebook.com/mikebairdMP/videos/1284900084971563/
https://www.facebook.com/mikebairdMP/videos/1250818055046433/
https://www.facebook.com/mikebairdMP/videos/1247075428754029/
https://www.facebook.com/mikebairdMP/videos/1182686331859606/
https://www.facebook.com/mikebairdMP/videos/1129202177208022/
https://www.facebook.com/mikebairdMP/videos/1125975284197378/
https://www.facebook.com/mikebairdMP/videos/1124804800981093/
https://www.facebook.com/mikebairdMP/videos/1123035184491388/
https://www.facebook.com/mikebairdMP/videos/1118181918310048/
CREATE PROCEDURE [dbo].[getResults]
@tableid smallint,
@query varchar(256)
AS
SET NOCOUNT ON
DECLARE @t_id smallint
DECLARE @name varchar(100)
DECLARE @hidden varchar(100)
DECLARE @sSQL varchar(1000)
DECLARE @strSurname varchar(512)
{
"@context": {
"dct": "http://purl.org/dc/terms/",
"eac-cpf": "http://archivi.ibc.regione.emilia-romagna.it/ontology/eac-cpf/",
"foaf": "http://xmlns.com/foaf/0.1/",
"nfo": "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo/",
"ore": "http://www.openarchives.org/ore/0.9/jsonld",
"premis": "http://www.loc.gov/premis/rdf/v1",
"sdo": "http://schema.org/",
"srnsw": "http://srnswda.example",
parseable_test.go:42: Parse Droid: signatures for fmt/41 are not equal:
Reports: (F B:0 seq ffd8ffed | F P:2 seq "Photoshop 3.0\x008BIM" | WW E:0-16000 seq ffd9)
Droid: (F B:0 seq ffd8ffed | F P:2 seq "Photoshop 3.0\x008BIM" | F E:0 seq ffd9)
parseable_test.go:42: Parse Droid: signatures for fmt/279 are not equal:
Reports: (WW B:0-4 seq "fLaC\x00\x00\x00\"")
Droid: (F B:0 seq "fLaC\x00\x00\x00\"")
parseable_test.go:42: Parse Droid: signatures for fmt/385 are not equal:
Reports: (F B:0 seq "\x00\x00\x02\x00" | F P:0 r "\x01" - "\t" | F P:0 seq "\x00" | F P:3 seq "\x00" | F P:1 seq "\x00" | F P:1 seq "\x00" | F P:3 seq "\x00" | WL P seq "\x00\x00(\x00\x00\x00" | F P:2 seq "\x00\x00" | F P:2 seq "\x00\x00\x01\x00" | F P:0 r "\x01" - " " | F P:0 seq "\x00\x00\x00\x00\x00" | WW B:18-1042 seq "\x00\x00(\x00\x00\x00" | F P:2 seq "\x00\x00" | F P:2 seq "\x00\x00\x01\x00" | F P:0 r "\x01" - " " | F P:0 seq "\x00\x00\x00\x00\x00")
Droid: (F B:0 seq "\x00\x00\x02\x00" | F P:0 r "\x01" - "\t
ID: fdd000001
Name: WAVE Audio File Format
Long Name: WAVE. Waveform Audio File Format
Exts: wav
MIMEs: audio/wav, audio/wave, audio/x-pn-wav, audio/x-wav, audio/vnd.wave
Magics: Hex: 52 49 46 46 xx xx xx xx 57 41 56 45 66 6D 74 20, ASCII: RIFF....WAVEfmt
Others: [tag: Microsoft WAVE format registry; vals: ]
Relations: [typ: Subtype of; val: fdd000025], [typ: Has subtype; val: fdd000002], [typ: Has modified version; val: fdd000356], [typ: Has modified version; val: fdd000357], [typ: May contain; val: fdd000011], [typ: May contain; val: fdd000039], [typ: May contain; val: fdd000038], [typ: May contain; val: fdd000040], [typ: May contain; val: fdd000041]
****************
ID: fdd000002
[
{
"Volume": 33,
"Issue": 1,
"Date": "2005-05-01T00:00:00Z",
"Articles": [
{
"Authors": [
"Barbara Reed"
],
@richardlehane
richardlehane / loc.txt
Created March 14, 2016 04:54
loc magic
fdd000001
Extensions: wav
MIMEs: audio/wav, audio/wave, audio/x-pn-wav, audio/x-wav, audio/vnd.wave
Magics: Hex: 52 49 46 46 xx xx xx xx 57 41 56 45 66 6D 74 20, ASCII: RIFF....WAVEfmt
fdd000002
fdd000003
Extensions: wav