url_common 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ab8c804a828390106ee6e442cd46362ef5648ff9d41d36317f2644cb9f21e15
4
- data.tar.gz: 7d6068a766ed82a3c4fe724fe426549c9c56047acbf373eb46d87aba763dfab0
3
+ metadata.gz: bf016ee73428bc8dc46afb13ddf8aa1e21840650e38ac0b6c03d91c69453afca
4
+ data.tar.gz: '098c5fcaa13ee7bf0b390bfae0af56784ed25547d7b0946591c2619344f004ca'
5
5
  SHA512:
6
- metadata.gz: bddc296b7dae2781ec1ae7f8b8c79a1327e93bc1bfe30c761366033ef0882049948ea8c2ebbd7ce425aa7d437086b7ec38a4b30ebf0e976a4213990ef1e2d2b6
7
- data.tar.gz: 395a2d6fec4519067d4dbb08f78c3e67cd4b1d2b1c7c8083299398790c5b9f9e6db81aade8c093f6b2eb39975f30b6923a80634d928e9c6fad159e12bb6a840d
6
+ metadata.gz: 780507307f3b1c6745cddba4eeb37cbad88a623c8b6f694a51798c0347d80db5fffbc2210ffafe0b272e270ecc48bf036c35c7071384a656bcf0b0ca30cdc791
7
+ data.tar.gz: bd449bfe93ecdfe735c947c8d6caba91962493778cbfe899cc456a5f056db2102c3ff208084f3fbd3ce47b3383c4046d3a1c4a6c5a5504e6974a81e9b809d0cd
data/Gemfile.lock CHANGED
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- url_common (0.1.3)
11
+ url_common (0.1.5)
12
12
  fuzzyurl (~> 0.9.0)
13
13
  mechanize (~> 2.6)
14
14
 
@@ -1,3 +1,3 @@
1
1
  module UrlCommon
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.5"
3
3
  end
data/lib/url_common.rb CHANGED
@@ -542,5 +542,26 @@ module UrlCommon
542
542
 
543
543
  return UrlCommon.select_best_rssurl_from_rssurls(results)
544
544
  end
545
+
546
+ #based on this approach: https://medium.com/@sparkboldstudio/building-a-url-shortener-rails-app-96db60d3bf9d
547
+ #def self.generate_short_fid
548
+ #def self.create_fid
549
+ def self.generate_fid
550
+ rand(36**8).to_s(36)
551
+ end
552
+
553
+ def self.sanitize(long_url, url_base)
554
+ long_url.strip!
555
+ sanitize_url = self.long_url.downcase.gsub(/(https?:\/\/)|(www\.)/,"")
556
+ #"http://#{sanitize_url}"
557
+ url_base + sanitize_url
558
+ end
559
+
560
+ # todo expand on this by checking to make sure it doesn't call again
561
+ # should be fine but ttfn
562
+ def self.create_permalink(tbl, fld, url)
563
+ short_url = UrlCommon.generate_short_url
564
+ sanitized_url = UrlCommon.sanitize(url, "https://pullquotes.io/pull_quotes/")
565
+ end
545
566
 
546
567
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: url_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Johnson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-02 00:00:00.000000000 Z
11
+ date: 2022-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fuzzyurl