Mar. 18th, 2015

orleanz: (Default)
Universally that person's acumen is esteemed very little perceptive concerning whatsoever matters are being held as most profitably by mortals with sapience endowed to be studied who is ignorant of that

which the most in doctrine erudite and certainly by reason of that in them high mind's ornament deserving of veneration constantly maintain when by general consent they affirm that other circumstances being equal by no exterior splendour is the prosperity of a nation

efficaciously asserted than by the measure of how far forward may have progressed the tribute of its solicitude for that proliferent continuance which of evils the original if it be absent when fortunately present constitutes the certain sign of omnipotent nature's incorrupted benefaction.


Posted via m.livejournal.com.

orleanz: (main)
(Та самая где запрещают функции более 3 строчек длиной писать, и все такое.)
orleanz: (main)
прямо инлайн, на странице комментов

вот как это выглядит (сами айпишники убрал фотошопом из соображений прайвеси, у пользователя thedimka разрешение спросил)



гео айпи информацию резолвлю с своего собственного сервера, на основе бесплатной скачанной базы

ВЕСЬ сурс код, как видите, адски сложный, см. ниже (там еще кэширования не хватает, добавлю позже, чтобы не гонять одинаковые запросы)

как считаете, народ, есть смысл такое выложить в Хром Стор?

Я пользуюсь пока полчаса и очень прикольно. Прямо сразу видишь - тут тебя комментят с Сиэтла, тут из Банкгока, тут из аж штата Юта, Солт Лейк Сити!


(function doReplace() {

    $("span.b-leaf-ipaddr").each(function(ind, span) {
        var re = /\d+\.\d+\.\d+\.\d+/i;
        var found = span.textContent.match(re);
        if (found) {
            $.ajax({
                type: "GET",
                url: "http://lentascope.net/ip/" + found[0],
                success: function(msg){
                    span.textContent = span.textContent + ", " + msg;
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    console.error(textStatus);
                }
            });
        }
    });

 }

)();
orleanz: (main)
мой приватный Гео-айпи сервер - это Node+Mongo стоящие за nginx (как и принято у начинающих хипстеров, чай не пэхапе с апачем)

Нужно будет настроить Энджинекс так, чтобы он все запросы на получение геоданных кэшировал эдак на год, и не тревожил бы большу Ноду, когда приходит запрос на такой же айпишник как уже был

Вот я только не уверен - кэш Энджинекса - персистентный? переживает рестарт-ребут?
Page generated Oct. 1st, 2025 08:14 am
Powered by Dreamwidth Studios