page = requests.get('htttp://example.com').text
import requests
page = requests.get('htttp://example.com').text
fd = open('/tmp/thepage.html', 'w')
fd.write(page)
fd.close()
import logging
logging.basicConfig(level=logging.INFO)
import gntp.notifier
gntp.notifier.mini("The webpage example.com has changed!")
...
Try wget.
Personally i'd use C#.
You can do it in C/C++ but it will take a much longer to write.
Your best bet, if you get confused, and you probably will after reading everyones responses is to contract it out, there was a website where you could do this, Rent A Coder I think it was called, people asking for bids on work.
The task itself is insignificant and can be done quite easily for someone who has time / progrramming knowledge.
I want to write a small Windows application which I can run as a standalone EXE (without installation). Essentially all I need it to do is periodically check a webpage (or multiple sites) for changes and if it's updated, play a WAV file and display a small alert on top of all other windows alerting the user there are changes. The visual alert ideally should be something unobtrusive that just sits in the corner until it's dismissed (rather than a dialog box that pops up and steals focus).
I'm not a programmer at all and the last time I touched Visual Basic was in high school. Any suggestions on some software or language I can use to achieve this? I'm pretty out of touch with software development.
Personally i'd use C#.
You can do it in C/C++ but it will take a much longer to write.
... IFTTT could be an option, and it is simpler than writing your own tool. I put together a small "recipe" to send me an email whenever a feed updated in just a couple of minutes. It's free and pretty self explanatory.
Imports System.Net
Imports System.IO
Function getHTML(ByVal Address As String) As String
Dim wREQ As WebRequest
Dim wRSP As WebResponse
Dim Reader As StreamReader
wREQ = WebRequest.Create(Address)
wRSP = wREQ.GetResponse
Reader = New StreamReader(wRSP.GetResponseStream)
Return Reader.ReadToEnd
Reader.Close()
End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
TextBox1.Text = getHTML("http://www.google.com")
End Sub
To get a page in HTML with visual basic is not that hard:Code: [Select]Imports System.Net
Imports System.IO
Function getHTML(ByVal Address As String) As String
Dim wREQ As WebRequest
Dim wRSP As WebResponse
Dim Reader As StreamReader
wREQ = WebRequest.Create(Address)
wRSP = wREQ.GetResponse
Reader = New StreamReader(wRSP.GetResponseStream)
Return Reader.ReadToEnd
Reader.Close()
End Function
Call the function like this:
String1 = getHTML("http://www.google.com")
then use a timer to call it again and compare the result with String1. If there is a difference do whatever alert you want.
Or if you want toplay with ittest it put a button and a textbox on your form andCode: [Select]Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
TextBox1.Text = getHTML("http://www.google.com")
End Sub
using System.Net;
using System.IO;
namespace httpget
{
class Program
{
static void Main(string[] args)
{
// this will just dump raw data to the screen
System.Console.WriteLine(getHTML("http://www.google.com"));
System.Console.ReadLine();
// or you could do
// string string1 = getHTML("http://www.google.com");
}
static string getHTML(string Address)
{
WebRequest wREQ;
WebResponse wRSP;
wREQ = WebRequest.Create(Address);
wRSP = wREQ.GetResponse();
StreamReader Reader = new StreamReader(wRSP.GetResponseStream());
try
{
return Reader.ReadToEnd();
}
finally
{
Reader.Close();
}
}
}
}
# // first argument is mapped to $url
param($url)
# // create a request
[Net.HttpWebRequest] $req = [Net.WebRequest]::create($url)
$req.Method = "GET"
$req.Timeout = 600000 # = 10 minutes
# // Set if you need a username/password to access the resource
#$req.Credentials = New-Object Net.NetworkCredential("username", "password");
[Net.HttpWebResponse] $result = $req.GetResponse()
[IO.Stream] $stream = $result.GetResponseStream()
[IO.StreamReader] $reader = New-Object IO.StreamReader($stream)
[string] $output = $reader.readToEnd()
$stream.flush()
$stream.close()
# // return the text of the web page
Write-Host $output
Usage: PowerShell is da bomb.
There are like 8 hours of training at Microsoft, I did a couple of hours but it's in my list of things to continue
http://www.microsoftvirtualacademy.com/training-courses/getting-started-with-powershell-3-0-jump-start