fb-parser 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf8305ddce3052f7560e83526a09ae8c3b959ac5
4
- data.tar.gz: 895339d678aa5bd86bb01065a666f3d89fba195c
3
+ metadata.gz: 1123ccc60c776a51db26bfc068d0cdde0a0ac75c
4
+ data.tar.gz: 19adbd37fd284ebf3054433e45a6e4c54a91c7a2
5
5
  SHA512:
6
- metadata.gz: 699bd198de880ef607927bffb7edb5b740c7a6f4f6ddb5fcc8056d39f072b42d94ae28304672b1676bf62c6ec3150aa6890ef28413705009ca1ad3fc196a5db6
7
- data.tar.gz: 1ddbed78f5f935ab32d3b3a24feb452f99123e86962fcbe1b5f4ff08ef3aa326a2656abf9f0120655bf89602f0e4ad7f4530246924f3c03d85807b58a40e0ce7
6
+ metadata.gz: fc23d7dc23c96de70fc015fc4c5b8295815882af2c9bf21931594d5983146498b8becdd4d97351baa1c9e559b6821fa1873682ab594e8aef9ca8ad3cbdfd12fb
7
+ data.tar.gz: 41fa6e972ef0454b0621256a374e2ddce6fb77fc51f48894c73820994523d9f1d3d2ff8d1a415e85b3acc04b2ed9b722f320cda2d7442c9a51bfd807d1fedb44
data/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
data/bin/bundle ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
data/bin/rails ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ APP_PATH = File.expand_path('../config/application', __dir__)
8
+ require_relative '../config/boot'
9
+ require 'rails/commands'
data/bin/rake ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require_relative '../config/boot'
8
+ require 'rake'
9
+ Rake.application.run
data/bin/setup ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a starting point to setup your application.
15
+ # Add necessary setup steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ # Install JavaScript dependencies if using Yarn
22
+ # system('bin/yarn')
23
+
24
+
25
+ # puts "\n== Copying sample files =="
26
+ # unless File.exist?('config/database.yml')
27
+ # cp 'config/database.yml.sample', 'config/database.yml'
28
+ # end
29
+
30
+ puts "\n== Preparing database =="
31
+ system! 'bin/rails db:setup'
32
+
33
+ puts "\n== Removing old logs and tempfiles =="
34
+ system! 'bin/rails log:clear tmp:clear'
35
+
36
+ puts "\n== Restarting application server =="
37
+ system! 'bin/rails restart'
38
+ end
data/bin/spring ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require 'rubygems'
8
+ require 'bundler'
9
+
10
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11
+ spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12
+ if spring
13
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14
+ gem 'spring', spring.version
15
+ require 'spring/binstub'
16
+ end
17
+ end
data/bin/update ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ puts "\n== Updating database =="
22
+ system! 'bin/rails db:migrate'
23
+
24
+ puts "\n== Removing old logs and tempfiles =="
25
+ system! 'bin/rails log:clear tmp:clear'
26
+
27
+ puts "\n== Restarting application server =="
28
+ system! 'bin/rails restart'
29
+ end
data/bin/yarn ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ VENDOR_PATH = File.expand_path('..', __dir__)
3
+ Dir.chdir(VENDOR_PATH) do
4
+ begin
5
+ exec "yarnpkg #{ARGV.join(" ")}"
6
+ rescue Errno::ENOENT
7
+ $stderr.puts "Yarn executable was not detected in the system."
8
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9
+ exit 1
10
+ end
11
+ end
@@ -0,0 +1,25 @@
1
+ require 'nokogiri'
2
+
3
+ namespace :meter do
4
+
5
+ desc "Show facebook shares count"
6
+
7
+ task :parse, [:addr, :limit] => [:environment] do |t, args|
8
+
9
+ site = Site.create(domain: args['addr'])
10
+
11
+ sitemap = Nokogiri::XML(open("https://www.#{site.domain}/sitemap.xml"))
12
+
13
+ item = sitemap.css('loc')
14
+
15
+ item.each do |nod|
16
+ fb_resp = Nokogiri::XML(open("https://graph.facebook.com/?ids=#{nod.inner_text}"))
17
+ Page.create(url: nod.inner_text)
18
+ Metric.create(shares: fb_resp)
19
+
20
+ puts fb_resp
21
+ end
22
+
23
+ end
24
+
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Webinar LTD
@@ -15,7 +15,16 @@ email:
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
- files: []
18
+ files:
19
+ - README.md
20
+ - bin/bundle
21
+ - bin/rails
22
+ - bin/rake
23
+ - bin/setup
24
+ - bin/spring
25
+ - bin/update
26
+ - bin/yarn
27
+ - lib/tasks/meter.rake
19
28
  homepage:
20
29
  licenses: []
21
30
  metadata: {}