https://github.com/atomaka/scrape-and-text
Simple example application from Lansing Ruby Meetup 08 Nov 2016
https://github.com/atomaka/scrape-and-text
Last synced: about 1 year ago
JSON representation
Simple example application from Lansing Ruby Meetup 08 Nov 2016
- Host: GitHub
- URL: https://github.com/atomaka/scrape-and-text
- Owner: atomaka
- Created: 2016-11-09T03:41:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-09T03:43:04.000Z (over 9 years ago)
- Last Synced: 2025-02-12T10:54:37.673Z (over 1 year ago)
- Language: Ruby
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby User Group, 08 Nov 2016
Text alerting on a website content change
* web request
```
require 'net/http'
uri = URI('https://github.com/chrisvfritz')
content = Net::HTTP.get(uri)
```
* parse content
```
require 'nokogiri'
parsed = Nokogiri::HTML(content)
chris_face = parse.css('.avatar').attr('src').value
```
* ??? (process)
* send text
```
require 'twilio-ruby'
client = Twilio::REST::Client.new(account_sid, auth_token)
client.messages.create(
from: from_number,
to: notification_number,
body: 'Repos changed'
)
```