Проверка на изменение страницы - Форум успешных вебмастеров - GoFuckBiz.com
 
 
Форум успешных вебмастеров - GoFuckBiz.com

  Форум успешных вебмастеров - GoFuckBiz.com > Бизнес-решения > Скрипты, программы и технические решения
Дата
USD/RUB93.4409
BTC/USD64260.8938
Скрипты, программы и технические решения Обсуждаем скрипты, программы и новые технологии.

Закрытая тема
Опции темы Опции просмотра
Старый 15.08.2011, 19:56   #1
KongWeiLing
Senior Member
 
Аватар для KongWeiLing
 
Регистрация: 28.03.2011
Сообщений: 419
Бабло: $81005
По умолчанию Проверка на изменение страницы

Знает ли кто софт для следующей задачи:
Есть урл, к сожалению без рсс, по сути фид по поисковому запросу, мне надо проверять его на изменение примерно каждый час, и в случае если страница изменилась уведомить об этом, а лучше выдать изменение, обычно оно будет фиксировано в первом чемнить типа <div class="item">.

В принципе можно самому написать, но тут замкнутый круг) прога нужна чтобы сэкономить время, и писать ее некогда)) может кто знает софт хотябы частично решающий задачу? например тупо рефрешил бы страницу и если в ней изменялось что-то извещал был.
KongWeiLing вне форума  
Старый 15.08.2011, 19:59   #2
maxtrade
Ебланнед
 
Регистрация: 12.02.2011
Адрес: -> Ower
Сообщений: 1,196
Бабло: $159385
По умолчанию

Можно попробовать по HTTP заголовку Last-Modified палить.
В ПХП забиваешь проверку по крону и в случае изменение - информирование куда надо
__________________
Start earn with Alcuda LTD! Up to $120 per each paid order
maxtrade вне форума  
Старый 15.08.2011, 21:25   #3
tobari
Senior Member
 
Регистрация: 03.09.2010
Сообщений: 827
Бабло: $99806
По умолчанию

wget + diff
в гугле даже готовые решения нашлись
http://www.mostlymaths.net/2010/01/c...n-webpage.html

Код:
#!/bin/bash

# Copyright 2009 Ruben Berenguel

# ruben /at/ maia /dot/ ub /dot/ es

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# PageDiffs: Fill in an array of webpages, with the option "write"
# will download them, with the "diff" option will re-download them and
# check the new against the old for differences. With the "diff mail"
# option, will send an email to $MAILRECIPIENT, assuming mail works.
# You can find the most up to date version of this file here
# http://rberenguel.googlecode.com/svn...h/PageDiffs.sh

# 20091226@00:24 Ruben Berenguel

# 20100818@07:10 Steve Almond from silkandslug.com found & solved a
# sh/bash problem. Suggestion for next revision: emailing diff

# 20100818@07:27 Previous suggestion forced as default. Now there is
# also the diff in the mail. For the next revision, add a command line
# switch to enable/disable it.

MAILRECIPIENT="[email protected]"

j=0
Pages[j++]="http://www.maia.ub.es/~ruben/"
Pages[j++]="http://www.google.es"
Pages[j++]="http://www.marca.com"

if [ "$1" = "write" ]; then
    echo Generate files
    count=0
    for i in "${Pages[@]}"
    do
	echo Getting "$i" into File$count
	wget "$i" -v -O "File$count"
	let count=$count+1
    done
fi
if [ "$1" = "diff" ]; then
    count=0

    for i in "${Pages[@]}"
    do
	# echo Getting "$i" into Test$count
	wget "$i" -q -O "Test$count"
	Output=$(diff -q "Test$count" "File$count" | grep differ)
	Result=$?
	if [ "$Result" = "0" ]; then
	    if [ "$2" = "mail" ]; then
		echo "******************************************" >> MailCont
		echo Page at "$i" has changed since last check! >> MailCont
		echo Diff follows >> MailCont
		echo -e "\n\n\n" >> MailCont
		diff "Test$count" "File$count" >> MailCont
		echo Diff follows >> MailCont
		echo "******************************************" >> MailCont
		mail="1"
	    fi
	    echo Page at "$i" has changed since last check!
	else
	    echo Page at "$i" has not changed since last check!
	fi
	#rm Test$count
	let count=$count+1
    done
    if [ "$mail" = "1" ]; then 
	mail -s "Page changed alert!" $MAILRECIPIENT < MailCont			
	rm MailCont
    fi
fi
и в крон засунуть
tobari вне форума  
Старый 15.08.2011, 21:33   #4
pepper
Senior Member
 
Регистрация: 04.06.2008
Сообщений: 466
Бабло: $172376
По умолчанию

Website watcher тебе в помощь

pepper вне форума  
Старый 15.08.2011, 21:56   #5
KongWeiLing
Senior Member
 
Аватар для KongWeiLing
 
Регистрация: 28.03.2011
Сообщений: 419
Бабло: $81005
ТС -->
автор темы ТС По умолчанию

Цитата:
Сообщение от pepper Посмотреть сообщение
Website watcher тебе в помощь

оооо, вот я так это и представлял себе!! Спасибо всем, а тебе особенно)
KongWeiLing вне форума