pornsieve  0.0.0
Search porn sites and filter the results using regular expressions
search.hpp
Go to the documentation of this file.
1 /* This file is part of pornsieve.
2  * Copyright © 2021 tastytea <tastytea@tastytea.de>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License as published by
6  * the Free Software Foundation, version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
23 #ifndef PORNSIEVE_SOURCES_HPP
24 #define PORNSIEVE_SOURCES_HPP
25 
26 #include <chrono>
27 #include <cstdint>
28 #include <string>
29 #include <vector>
30 
31 namespace pornsieve
32 {
33 
34 using std::string;
35 using std::vector;
38 
46 enum class result_order
47 {
48  none,
49  newest,
50  mostviewed,
51  rating,
52  longest,
53  shortest,
54  popular,
55  popular_week,
56  popular_month
57 };
58 
64 enum class media_type
65 {
66  video
67 };
68 
75 {
81  struct item
82  {
83  string title;
84  string description;
85  string url;
86  std::chrono::seconds duration{};
87  vector<string> tags;
88  vector<string> thumbnails;
89  float rating{0};
90  uint64_t views{0};
92  };
93 
94  string original_data;
95  std::uint64_t count;
96  vector<item> items;
97 };
98 
99 } // namespace pornsieve
100 
101 #endif // PORNSIEVE_SOURCES_HPP
pornsieve::search_result::item::title
string title
Title of the video/picture.
Definition: search.hpp:83
pornsieve::search_result::original_data
string original_data
The raw data returned from the API.
Definition: search.hpp:94
pornsieve::search_result::item::rating
float rating
Rating in percent.
Definition: search.hpp:89
pornsieve::search_result::items
vector< item > items
Search result items.
Definition: search.hpp:96
pornsieve
The namespace containing the pornsieve library.
Definition: config.hpp:30
pornsieve::search_result::item
A single search result item.
Definition: search.hpp:81
pornsieve::search_result::item::thumbnails
vector< string > thumbnails
URLs of thumbnails.
Definition: search.hpp:88
pornsieve::search_result::item::tags
vector< string > tags
Tags associated with the video/image.
Definition: search.hpp:87
pornsieve::search_result::count
std::uint64_t count
Number of results.
Definition: search.hpp:95
pornsieve::result_order
result_order
Order of the search results.
Definition: search.hpp:46
pornsieve::search_result::item::url
string url
URL of the video/picture.
Definition: search.hpp:85
pornsieve::search_result::item::duration
std::chrono::seconds duration
Duration of the video in seconds.
Definition: search.hpp:86
pornsieve::search_result::item::date
time_point date
Date the video/picture was published.
Definition: search.hpp:91
pornsieve::search_result::item::views
uint64_t views
Number of views.
Definition: search.hpp:90
pornsieve::media_type
media_type
Which type of media to search for.
Definition: search.hpp:64
pornsieve::search_result::item::description
string description
Description of the video/picture.
Definition: search.hpp:84
pornsieve::time_point
std::chrono::system_clock::time_point time_point
In this lib we use the system clock for our time points.
Definition: helpers.hpp:38
pornsieve::search_result
Search results.
Definition: search.hpp:74