500px.com View

Gets you to the real image (and more)!

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         500px.com View
// @namespace    github.com/hrxn
// @version      0.5
// @description  Gets you to the real image (and more)!
// @author       Hrxn <github.com/hrxn>
// @license      Creative Commons BY-NC-SA
// @match        *://500px.com/*
// @grant        none
// @icon         https://assetcdn.500px.org/assets/favicon-1e8257b93fb787f8ceb66b5522ee853c.ico
// ==/UserScript==
'use strict';

var fivehundredpx = function () {
    var resrc = [];
    var rname = [];
    function conWrite(link, title) {
        console.log(link);
        console.log(title);
    }
    function addLinks(src, fn) {
        var el = document.querySelector('.main_container .sidebar_region .actions_region');
        el.insertAdjacentHTML('afterEnd', '<a href="' + src + '" target="_blank"> [ View... ] </a> | <a href="' + src + '" download="' + fn + '"> [ Try Download... ] </a>');
    }
    function aryreset() {
        resrc = [];
        rname = [];
    }
    function afilters(s1, s2) {
        s2 = s2.replace(" on 500px", "");
        resrc.push(s1);
        rname.push(s2);
        if (resrc.length > 1 && rname.length > 1) {
            var r1 = resrc[resrc.length - 1];
            var r2 = rname[rname.length - 1];
            addLinks(r1, r2);
            conWrite(r1, r2);
            aryreset();
        } else {
            var r3 = resrc[0];
            var r4 = rname[0];
            addLinks(r3, r4);
            conWrite(r3, r4);
        }
    }
    var observerHandler = function (mutations) {
        mutations.forEach(function (mutation) {
            if (mutation.type === 'attributes' && mutation.attributeName === 'src' && mutation.target.className === 'photo' && mutation.target.src.indexOf('m%3D2048') > 0) {
                afilters(mutation.target.src, mutation.target.alt);
            }
        });
    };
    var MutationObserver = window.MutationObserver;
    var target = document.querySelector('body');
    var observer = new MutationObserver(observerHandler);
    var config = {attributes: true, subtree: true};
    observer.observe(target, config);
};
fivehundredpx();