Open aaronpk opened 9 years ago
can you also detect http vs https confusion?
Just a note from indieauth-node-clone.
Using Geraint's URI-templates here to avoid this.
It can parse the id
from templates
and then use id
with target
...
Apart from JSON schemes for every provider, this is a json-"summary" used for the providers.
{
"flickr": {
"active": true,
"title": "flickr",
"templates": [
"{protocol:5}://{www:3.*}flickr.com/photos{/id,path*}",
"{protocol:5}://{www:3.*}flickr.com/people{/id,path*}"
],
"target": "https://www.flickr.com/people{/id}",
"description": "The home for all your photos.\nUpload, access, organize, edit, and share your photos from any device, from anywhere in the world.",
"translations": {
"description": {
"de": "Die Seite für all deine Fotos.\nLade deine Fotos hoch, greife auf sie zu, sortiere, bearbeite und teile sie – über jedes Gerät und von überall auf der Welt aus.",
"fr": "Le site de toutes vos photos.\nImportez, regardez, organisez, retouchez et partagez vos photos depuis n'importe quel appareil, où que vous soyez.",
"es": "El hogar de todas tus fotos.\nSube tus fotos, accede a tu contenido, organízalo, edítalo y compártelo desde cualquier dispositivo y desde cualquier parte del mundo.",
"zh": "一個地方,存放你的所有相片。\n隨時隨地都可以使用任何裝置上傳、存取、整理、編輯及分享你的相片。"
}
},
"svg": "<circle fill='#3E373C' cx='224' cy='224' r='224'/> <circle fill='#FF0084' cx='224' cy='224' r='204'/> <path fill='#FFFFFF' d='M236,226.001C236,201.698,255.727,182,280.066,182c24.333,0,44.067,19.699,44.067,44.001c0,24.3-19.734,43.999-44.067,43.999C255.727,270,236,250.301,236,226.001z M249.552,226.001c0,16.823,13.631,30.461,30.462,30.461c16.817,0,30.463-13.638,30.463-30.461c0-16.818-13.646-30.462-30.463-30.462C263.183,195.538,249.552,209.176,249.552,226.001z'/> <circle fill='#116DDA' cx='168' cy='226' r='44'/>"
},
"github": {
"active": true,
"title": "GitHub",
"templates": ["{protocol:5}://{www:3.*}github.com{/id,path*}"],
"target": "https://github.com{/id}",
"description": "Build software better, together.\nWe’re supporting a community where more than 15 million people learn, share, and work together to build software.",
"translations": {
"description": {
"de": "Mache Software besser, zusammen.\nEine Community, wo mehr als 15 Millionen Menschen lernen, teilen und zusammenarbeiten um Software zu bauen."
}
},
"svg": "<circle fill='#3E373C' cx='224' cy='224' r='224'/> <circle fill='#000000' cx='224' cy='224' r='204'/> <path fill='#FFFFFF' d='M143.443,236.848c9.585,17.081,28.069,27.704,59.248,30.646c-4.452,3.312-9.797,9.604-10.533,16.876c-5.597,3.554-16.846,4.725-25.596,2.019c-12.258-3.803-16.949-27.618-35.304-24.226c-3.976,0.735-3.187,3.312,0.252,5.49c5.594,3.554,10.862,7.997,14.923,17.46c3.12,7.268,9.675,20.251,30.414,20.251c8.229,0,13.994-0.969,13.994-0.969s0.156,18.541,0.156,25.755c0,8.309-11.432,10.656-11.432,14.654c0,1.585,3.782,1.729,6.826,1.729c6.008,0,18.518-4.921,18.518-13.564c0-6.863,0.112-29.952,0.112-33.99c0-8.826,4.824-11.624,4.824-11.624s0.6,47.133-1.15,53.452c-2.056,7.427-5.763,6.372-5.763,9.688c0,4.928,15.056,1.207,20.046-9.604c3.859-8.432,2.167-54.66,2.167-54.66l4.119-0.086c0,0,0.232,21.166,0.092,30.841c-0.145,10.02-0.836,22.688,5.229,28.673c3.981,3.926,16.899,10.814,16.899,4.516c0-3.657-7.082-6.671-7.082-16.575V288c5.648,0,4.804,14.993,4.804,14.993l0.407,27.856c0,0-1.237,10.146,11.193,14.396c4.377,1.505,13.769,1.909,14.203-0.607c0.445-2.533-11.299-6.303-11.404-14.164c-0.063-4.787,0.222-7.586,0.222-28.423c0-20.825-2.854-28.53-12.785-34.667c30.653-3.097,49.633-10.534,58.877-30.47c0.726,0.026,3.769-9.311,3.369-9.311c2.071-7.525,3.192-16.425,3.422-26.971c-0.058-28.577-13.998-38.689-16.681-43.438c3.951-21.637-0.653-31.49-2.799-34.865c-7.896-2.759-27.481,7.095-38.174,14.037c-17.453-5.006-54.312-4.521-68.137,1.294c-25.51-17.931-39.007-15.186-39.007-15.186s-8.72,15.345-2.302,37.79c-8.395,10.497-14.647,17.924-14.647,37.608c0,11.097,1.329,21.021,4.33,29.688C138.927,227.565,143.324,236.855,143.443,236.848z'/>"
},
"google": {
"active": true,
"title": "google+",
"templates": [
"{protocol:5}://{www:3.*}profiles.google.com{/id,path*}",
"{protocol:5}://{www:3.*}plus.google.com{/id,path*}"
],
"target": "https://plus.google.com{/id}/about",
"description": "Get way into what you love. Real-life sharing rethought for the web.",
"translations": {
"description": {
"de": "Teilen wie im richtigen Leben, neu erfunden für das Web.",
"fr": "Partagez le Web comme vous le vivez.",
"es": "Comparte en Internet como en la vida real.",
"zh": "Let's Meet Here. Real-life sharing rethought for the web."
}
},
"svg": "<circle fill='#3E373C' cx='224' cy='224' r='224'/> <circle fill='#FFFFFF' cx='224' cy='224' r='203'/> <path fill='#D34836' d='M224.003,20C111.333,20,20,111.202,20,223.705c0,112.501,91.333,203.704,204.003,203.704c3.023,0,6.028-0.079,9.02-0.209c19.362-8.839,29.387-24.637,29.387-43.568c0-24.238-15.544-37.034-51.776-62.803c-3.759-0.338-6.153-0.338-10.937-0.338c-4.274,0-29.909,0.854-49.902,7.506c-10.424,3.754-40.844,15.192-40.844,48.978c0,3.674,0.391,7.234,1.153,10.662c-33.61-24.898-34.909-30.739-33.843-31.887c-0.08,0.003-0.165,0.005-0.26,0.005c5.702-9.575,14.548-18.991,27.651-26.729c29.565-18.091,69.384-20.484,90.914-21.843c-6.663-8.534-14.352-17.58-14.352-32.427c0-8.023,2.391-12.797,4.785-18.428c-5.299,0.51-10.425,1.021-15.212,1.021c-50.412,0-78.953-37.545-78.953-74.571c0-21.843,10.083-46.112,30.42-63.671C148.424,96.806,180.724,93,206.359,93h97.922l-30.416,17.082h-29.402c10.94,9.025,33.673,28.016,33.673,64.162c0,35.157-19.998,51.708-39.818,67.404c-6.326,6.146-13.334,12.805-13.334,23.208c0,10.41,7.008,16.213,12.307,20.483l17.095,13.309c21.019,17.406,39.985,33.619,39.986,66.384c0,20.703-9.28,41.483-27.37,57.828C359.013,403.144,428,321.474,428,223.705C428,111.202,336.664,20,224.003,20z M373.371,230.56h-22.729v-53.524h-53.063v-22.28h53.062v-53.055h22.73v53.055h40.51c2.99,7.228,5.577,14.661,7.738,22.28h-48.247V230.56z M176.453,108.662c-12.308,0-25.636,6.181-33.325,15.683c-8.032,9.968-10.427,22.765-10.427,35.053c0,31.916,18.458,84.645,59.474,84.645c11.79,0,24.608-5.802,32.303-13.315c10.93-10.922,11.791-26.106,11.791-34.641C236.269,161.784,215.927,108.662,176.453,108.662z'/>"
},
"lastfm": {
"active": true,
"title": "last.fm",
"templates": ["{protocol:5}://{www:3.*}last.fm/user{/id,path*}"],
"target": "https://www.last.fm/user{/id}",
"description": "We bring together your favourite music services and join up listening, watching and sharing to connect your musical world.",
"translations": {
"description": {
"de": "Wir vereinen deine liebsten Musikdienste. Mit uns kannst du Titel hören, Videos ansehen und dich mit anderen austauschen, um eure musikalischen Welten zu vereinen.",
"fr": "Nous vous proposons en un même endroit vos services de musique préférés et rassemblons écoute, visionnement et partage afin de mieux connecter votre monde musical.",
"es": "Centralizamos todos tus servicios de música favoritos y ponemos en un solo lugar la posibilidad de escuchar, ver y compartir tu mundo musical.",
"zh": "我们将您最喜爱的音乐服务组合到一起,把收听、观看和分享结合起来,让您与音乐世界紧密联系。"
}
},
"svg": "<circle fill='#3E373C' cx='224' cy='224' r='224'/> <circle fill='#e00024' cx='224' cy='224' r='204'/> <path fill='#FFFFFF' d='M311.046,310.508c-30.075-0.12-46.086-14.923-57.226-41.012l-3.189-7.12l-27.448-63.008c-9.109-22.303-31.695-37.364-57.195-37.364c-34.472,0-62.445,28.167-62.445,62.913s27.974,62.912,62.445,62.912c24.067,0,44.976-13.686,55.431-33.771l11.099,25.773c-15.754,19.346-39.707,31.67-66.514,31.67C118.5,311.5,80,272.766,80,224.916c0-47.826,38.5-86.616,86.003-86.616c35.858,0,64.791,19.282,79.496,53.44c1.12,2.641,15.561,36.623,28.143,65.561c7.797,17.906,14.449,29.769,36.02,30.503c21.182,0.731,35.728-12.242,35.728-28.665c0-16.037-11.082-19.895-29.808-26.161c-33.651-11.172-51.025-22.375-51.025-49.253c0-26.208,17.704-43.686,46.49-43.686c18.75,0,32.281,8.409,41.656,25.153l-18.396,9.456c-6.934-9.771-14.58-13.628-24.291-13.628c-13.516,0-23.149,9.464-23.149,22.052c0,17.848,15.867,20.546,38.049,27.884c29.875,9.794,43.752,20.982,43.752,48.915C368.683,289.197,343.666,310.549,311.046,310.508L311.046,310.508z'/>"
},
"stackexchange": {
"active": true,
"title": "StackExchange",
"templates": ["{protocol:5}://{www:3.*}stackexchange.com/users{/id,name,path*}"],
"target": "http://stackexchange.com/users{/id}{/name}",
"description": "The world’s largest programming community is growing. Stack Exchange is a network of 150+ Q&A communities including Stack Overflow.",
"translations": {
"description": {
"de": "Die größte Programmiergemeinschaft der Welt wächst. Stack Exchange ist ein Netzwerk von 150+ Q&A Portalen, u. a. Stack Overflow."
}
},
"svg": "<circle fill='#3E373C' cx='224' cy='224' r='224'/> <circle fill='#17284d' cx='224' cy='224' r='204'/> <g><path fill='#4068BB' d='M131.32,260.602h185.429v-38.137H131.32V260.602z'/><path fill='#5CA3DE' d='M131.32,211.483h185.429v-38.146H131.32V211.483z'/><path fill='#9ADFF7' d='M287.323,122H160.715c-16.24,0-29.396,13.65-29.396,30.468v9.905h185.429v-9.905C316.749,135.65,303.573,122,287.323,122'/><path fill='#2D4E9B' d='M131.32,271.35v9.904c0,16.816,13.156,30.469,29.396,30.469h79.192V352l38.867-40.277h8.549c16.25,0,29.426-13.652,29.426-30.469v-9.904H131.32'/><path fill='#455CA6' d='M166.103,311.723h-5.388c-16.24,0-29.396-13.652-29.396-30.469v-9.904h73.74L166.103,311.723'/><path fill='#73AEE2' d='M262.822,211.483H131.32v-38.146h168.304L262.822,211.483'/><path fill='#5877C4' d='M215.43,260.602h-84.11v-38.137h120.912L215.43,260.602'/></g>"
},
"twitter": {
"active": true,
"title": "Twitter",
"templates": ["{protocol:5}://{www:3.*}twitter.com{/id,path*}"],
"target": "https://twitter.com{/id}",
"description": "Whats Happening. Our mission: To give everyone the power to create and share ideas and information instantly, without barriers.",
"translations": {
"description": {
"de": "Whats Happening. Unsere Mission: Es jedem zu ermöglichen, Ideen und Informationen sofort und ohne Barrieren zu erstellen und zu teilen.",
"fr": "Whats Happening. Notre mission : donner à chacun le pouvoir de créer et de partager des idées et des informations instantanément et sans entraves.",
"es": "Whats Happening. Nuestra misión: Darle a todos el poder de generar y compartir ideas e información al instante y sin obstáculos.",
"zh": "Whats Happening. 我们的使命:让每个人都能畅通无阻地随时提出和分享想法及资讯。"
}
},
"svg": "<circle fill='#3E373C' cx='224' cy='224' r='224'/> <circle fill='#24A9E6' cx='224' cy='224' r='204'/> <path fill='#FFFFFF' d='M218.813,180.373l0.477,7.857l-7.943-0.97c-28.929-3.684-54.208-16.208-75.659-37.232l-10.494-10.431l-2.704,7.715c-5.719,17.171-2.062,35.301,9.853,47.5c6.357,6.748,4.926,7.709-6.037,3.692c-3.816-1.286-7.15-2.249-7.469-1.768c-1.112,1.125,2.705,15.728,5.719,21.512c4.128,8.026,12.562,15.892,21.778,20.543l7.788,3.684l-9.218,0.163c-8.9,0-9.217,0.155-8.264,3.529c3.181,10.431,15.742,21.505,29.724,26.321l9.854,3.365l-8.581,5.134c-12.717,7.391-27.656,11.555-42.604,11.881c-7.149,0.162-13.034,0.798-13.034,1.279c0,1.605,19.39,10.594,30.678,14.122c33.858,10.431,74.075,5.94,104.284-11.874c21.452-12.68,42.92-37.875,52.93-62.264c5.399-12.999,10.808-36.758,10.808-48.145c0-7.383,0.48-8.344,9.382-17.169c5.235-5.143,10.167-10.756,11.123-12.362c1.599-3.046,1.434-3.046-6.673-0.318c-13.507,4.817-15.422,4.172-8.744-3.048c4.935-5.141,10.814-14.446,10.814-17.175c0-0.481-2.39,0.325-5.089,1.759c-2.853,1.606-9.217,4.01-13.996,5.468l-8.579,2.715l-7.784-5.289c-4.291-2.894-10.341-6.103-13.521-7.065c-8.101-2.249-20.507-1.923-27.816,0.645C229.941,141.373,217.382,159.985,218.813,180.373z'/>"
}
}
Twitter seems to be displaying profile URLs without the www prefix, even if the user entered in www.
If the user's Twitter profile URL starts with www and the verification is going to fail, show a warning message instead of the generic error.