summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lyrics_fetcher.cpp6
-rw-r--r--src/lyrics_fetcher.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lyrics_fetcher.cpp b/src/lyrics_fetcher.cpp
index c29d501d..8a501106 100644
--- a/src/lyrics_fetcher.cpp
+++ b/src/lyrics_fetcher.cpp
@@ -53,7 +53,7 @@ LyricsFetcher::Result LyricsFetcher::fetch(const std::string &artist, const std:
Result result;
result.first = false;
- std::string url = this->url();
+ std::string url = urlTemplate();
boost::replace_all(url, "%artist%", artist.c_str());
boost::replace_all(url, "%title%", title.c_str());
@@ -91,10 +91,10 @@ LyricsFetcher::Result LyricsFetcher::fetch(const std::string &artist, const std:
return result;
}
-std::vector<std::string> LyricsFetcher::getContent(const char *regex, const std::string &data)
+std::vector<std::string> LyricsFetcher::getContent(const char *regex_, const std::string &data)
{
std::vector<std::string> result;
- boost::regex rx(regex);
+ boost::regex rx(regex_);
auto first = boost::sregex_iterator(data.begin(), data.end(), rx);
auto last = boost::sregex_iterator();
for (; first != last; ++first)
diff --git a/src/lyrics_fetcher.h b/src/lyrics_fetcher.h
index 644d3e6d..44f1ae28 100644
--- a/src/lyrics_fetcher.h
+++ b/src/lyrics_fetcher.h
@@ -35,7 +35,7 @@ struct LyricsFetcher
virtual Result fetch(const std::string &artist, const std::string &title);
protected:
- virtual const char *url() = 0;
+ virtual const char *urlTemplate() = 0;
virtual const char *regex() = 0;
virtual bool notLyrics(const std::string &) { return false; }
@@ -52,7 +52,7 @@ struct LyricwikiFetcher : public LyricsFetcher
virtual Result fetch(const std::string &artist, const std::string &title);
protected:
- virtual const char *url() { return "http://lyrics.wikia.com/api.php?action=lyrics&fmt=xml&func=getSong&artist=%artist%&song=%title%"; }
+ virtual const char *urlTemplate() { return "http://lyrics.wikia.com/api.php?action=lyrics&fmt=xml&func=getSong&artist=%artist%&song=%title%"; }
virtual const char *regex() { return "<url>(.*?)</url>"; }
virtual bool notLyrics(const std::string &data);
@@ -65,7 +65,7 @@ struct GoogleLyricsFetcher : public LyricsFetcher
virtual Result fetch(const std::string &artist, const std::string &title);
protected:
- virtual const char *url() { return URL; }
+ virtual const char *urlTemplate() { return URL; }
virtual const char *siteKeyword() { return name(); }
virtual bool isURLOk(const std::string &url);