Version: 1.9.7
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
2 ways to extract elements from within XML namespaces using Nokogiri | |
When trying to select elemenets in the default namespace, e.g. "xmlns= http://www.w3.org/2005/Atom", try the following two ways. Note the xmlns=" attribute on entry element: | |
Original xml: | |
Nokogiri::XML(@xml_string).xpath("//author/name").each do |node| | |
puts node | |
end | |
1. Define a namespace context for your XPath expression and point your XPath steps to match elements in that namespace. Define a namespace-to-prefix mapping and use this prefix (a) in the XPath expression. |
#!/usr/bin/ruby | |
# Runs as follows: | |
# | |
# ~$ ruby tls-cert-generator.rb | |
require "openssl" | |
require "socket" |
server { | |
listen 8080; | |
server_name example.dev www.example.dev; | |
location / { | |
root /Users/Cobby/Sites/Example; | |
if ($host = 'www.example.dev' ) { | |
rewrite ^/(.*)$ http://example.dev:8080/$1 permanent; | |
} |
# -*- coding: utf-8 -*- | |
from scrapy.item import Item, Field | |
class RamenStyle(Item): | |
shop_id = Field() | |
style = Field() | |
soup = Field() | |
class RamenReview(Item): | |
review_id = Field() |
# Usage example: | |
# | |
# s = PinterestSpammer.new | |
# s.sign_in 'your_account_email', 'your_account_password' | |
# s.get_boards # get boards list, that contains board_id (for example - 455708124733779520) | |
# s.create_pin(455708124733779520, 'https://xyz.xyz/', 'http://rubyonrails.org/images/rails.png', 'Spammer!') | |
# | |
# | |
require 'mechanize' | |
class PinterestSpammer |