This repository has been archived by the owner on Jul 25, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added icefilms-shows and icefilms-episodes
Shows is like movies, gives you a two part ID for the show. You pass that to episodes and it lists them all for you with IDs. You pass the ID to sources.
- Loading branch information
1 parent
8d0afed
commit ff306d2
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# This script takes a show ID (which has two parts for some reason) and lists the IDs of the episodes | ||
show_id="$1" | ||
|
||
episode_list_url="http://www.icefilms.info/tv/series/$show_id" | ||
|
||
episode_list="$(curl -s "$episode_list_url")" | ||
|
||
echo "$episode_list" | ruby -rnokogiri -e ' | ||
Nokogiri::parse(STDIN.read).at("span.list").search("a").each do |item| | ||
if item["href"] | ||
id = item["href"].sub(/[^0-9]*([0-9]+).*/,"\\1") | ||
# Use to_i to only accept the numeric ids | ||
puts id + " " + item.content if id.to_i != 0 | ||
end | ||
end | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# This script takes a prefix for a show and finds IDs for shows with that prefix | ||
prefix="$1" | ||
|
||
first_letter="$(echo "$prefix" | cut -c 1 | tr 'a-z' 'A-Z')" | ||
|
||
show_list_url="http://www.icefilms.info/tv/a-z/$first_letter" | ||
|
||
show_list="$(curl -s "$show_list_url")" | ||
|
||
echo "$show_list" | ruby -rnokogiri -e ' | ||
Nokogiri::parse(STDIN.read).at("span.list").search("a").each do |item| | ||
if item.content.downcase.start_with?(ARGV[0].downcase) | ||
id = item["href"].sub(/[^0-9]*([0-9]+\/[0-9]+).*/,"\\1") | ||
puts id + " " + item.content | ||
end | ||
end | ||
' "$prefix" |