ayadn 1.4.0 → 1.4.1

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
  SHA1:
3
- metadata.gz: 6276f752eb491dd844708b87857de9e31ce9e908
4
- data.tar.gz: 53d08a3828136827d3125f47cdd340d924b6d55f
3
+ metadata.gz: 08a202fea9f47db0c64d1c9d0b1a12b809a25650
4
+ data.tar.gz: f620955c6f10034e69ee9969e51e1601d146275e
5
5
  SHA512:
6
- metadata.gz: 7b629af3a71e42b0e9fa1b4d6082dba04cc744ba5effa5609eca9d0cc3f8bbd8ad14ca5eab57144323c6c1acd9f03806250d00009f8bc816fec2d52611365964
7
- data.tar.gz: a4c36beb941ee96e3215783ec75fca897e62e0708e09a4238016d4ea2e6088b0073adf7c1d4e1447ecf407b39077b0d7e171f723101c49fcaf24cec5275ef86d
6
+ metadata.gz: 9790a6fdc3958a4329ac873d3aefeddbe86291215eca8e07cd8b863903673721062d166d2ff876703447b28902b1970c17c14679acc5e21ec780baa5209220b5
7
+ data.tar.gz: b167b9aae1d9f9535a380dd51d96823efd375356465ee055aeefe6b27c01d32a769e8755bc085875784864bfaf24aeb59293824468ddb41da26f9891b1a2ee07
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.4.1 - Fixes
2
+
3
+ - A few fixes here and there
4
+
1
5
  # 1.4.0 - 'Florian'
2
6
 
3
7
  - New feature: embed one or several pictures within a post (in write, post, reply, and pm)
data/lib/ayadn/action.rb CHANGED
@@ -932,7 +932,11 @@ module Ayadn
932
932
  @view.show_posted(Post.new.send_nowplaying(dic))
933
933
  rescue => e
934
934
  puts Status.wtf
935
- Errors.global_error("action/nowplaying", itunes, e)
935
+ if options['no_url']
936
+ Errors.global_error("action/nowplaying", itunes, e)
937
+ else
938
+ Errors.global_error("action/nowplaying", [itunes, store, options], e)
939
+ end
936
940
  end
937
941
  end
938
942
 
@@ -972,11 +976,8 @@ module Ayadn
972
976
  private
973
977
 
974
978
  def itunes_request itunes
975
- regex_exotics = /[~:-;,?!\'&`^=+<>*%()\/"“”’°£$€.…]/
976
- store_artist = itunes.artist.gsub(regex_exotics, ' ').split(' ').join('+')
977
- store_track = itunes.track.gsub(regex_exotics, ' ').split(' ').join('+')
978
- #store_album = itunes.album.gsub(regex_exotics, ' ').split(' ').join('+')
979
- itunes_url = "https://itunes.apple.com/search?term=#{store_artist}&term=#{store_track}&media=music&entity=musicTrack"
979
+ infos = itunes_reg([itunes.artist, itunes.track, itunes.album])
980
+ itunes_url = "https://itunes.apple.com/search?term=#{infos[0]}&term=#{infos[1]}&term=#{infos[2]}&media=music&entity=musicTrack"
980
981
  results = JSON.load(CNX.download(itunes_url))['results']
981
982
  candidate = results[0]
982
983
  {
@@ -989,6 +990,13 @@ module Ayadn
989
990
  }
990
991
  end
991
992
 
993
+ def itunes_reg arr_of_itunes
994
+ regex_exotics = /[~:-;,?!\'&`^=+<>*%()\/"“”’°£$€.…]/
995
+ arr_of_itunes.map do |itune|
996
+ itune.gsub(regex_exotics, ' ').split(' ').join('+')
997
+ end
998
+ end
999
+
992
1000
  def splitter_all words
993
1001
  [words].collect {|w| w.split(' ')}
994
1002
  end
data/lib/ayadn/fileops.rb CHANGED
@@ -43,7 +43,8 @@ module Ayadn
43
43
 
44
44
  def self.upload(path, token)
45
45
  begin
46
- file = Regexp.escape(path).gsub!('\.', '.')
46
+ temp = Regexp.escape(path).gsub('\.', '.')
47
+ file = temp.gsub('\-', '-')
47
48
  case File.extname(path).downcase
48
49
  when ".png"
49
50
  `curl -k -H 'Authorization: BEARER #{token}' https://api.app.net/files -F 'type=com.ayadn.files' -F "content=@#{file};type=image/png" -F 'public=true' -X POST`
data/lib/ayadn/post.rb CHANGED
@@ -42,9 +42,7 @@ module Ayadn
42
42
  end
43
43
 
44
44
  def send_pm_embedded_pictures dic
45
- url = Endpoints.new.pm_url
46
- url << "?include_annotations=1&access_token=#{Ayadn::Settings.user_token}"
47
- send_content(url, payload_pm_embedded(dic))
45
+ send_content(Endpoints.new.pm_url, payload_pm_embedded(dic))
48
46
  end
49
47
 
50
48
  def send_nowplaying dic
data/lib/ayadn/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Ayadn
3
- VERSION = "1.4.0"
3
+ VERSION = "1.4.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ayadn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dejonckheere