|
a/src/internfile/myhtmlparse.cpp |
|
b/src/internfile/myhtmlparse.cpp |
|
... |
|
... |
18 |
* along with this program; if not, write to the Free Software
|
18 |
* along with this program; if not, write to the Free Software
|
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
20 |
* USA
|
20 |
* USA
|
21 |
* -----END-LICENCE-----
|
21 |
* -----END-LICENCE-----
|
22 |
*/
|
22 |
*/
|
|
|
23 |
#include <time.h>
|
23 |
|
24 |
|
24 |
#include "myhtmlparse.h"
|
25 |
#include "myhtmlparse.h"
|
25 |
|
26 |
|
26 |
#include "indextext.h" // for lowercase_term()
|
27 |
#include "indextext.h" // for lowercase_term()
|
27 |
|
28 |
|
|
... |
|
... |
133 |
} else if (name == "keywords") {
|
134 |
} else if (name == "keywords") {
|
134 |
if (!keywords.empty()) keywords += ' ';
|
135 |
if (!keywords.empty()) keywords += ' ';
|
135 |
string tmp = i->second;
|
136 |
string tmp = i->second;
|
136 |
decode_entities(tmp);
|
137 |
decode_entities(tmp);
|
137 |
keywords += tmp;
|
138 |
keywords += tmp;
|
|
|
139 |
} else if (name == "date") {
|
|
|
140 |
// Yes this doesnt exist. It's output by filters
|
|
|
141 |
// And the format isn't even standard http/html
|
|
|
142 |
// FIXME
|
|
|
143 |
string tmp = i->second;
|
|
|
144 |
decode_entities(tmp);
|
|
|
145 |
struct tm tm;
|
|
|
146 |
if (strptime(tmp.c_str(),
|
|
|
147 |
" %Y-%m-%d %H:%M:%S ", &tm)) {
|
|
|
148 |
char ascuxtime[100];
|
|
|
149 |
sprintf(ascuxtime, "%ld", (long)mktime(&tm));
|
|
|
150 |
dmtime = ascuxtime;
|
|
|
151 |
}
|
138 |
} else if (name == "robots") {
|
152 |
} else if (name == "robots") {
|
139 |
string val = i->second;
|
153 |
string val = i->second;
|
140 |
decode_entities(val);
|
154 |
decode_entities(val);
|
141 |
lowercase_term(val);
|
155 |
lowercase_term(val);
|
142 |
if (val.find("none") != string::npos ||
|
156 |
if (val.find("none") != string::npos ||
|