Created
August 8, 2017 14:52
-
-
Save varyen/c746a6a7ba7e166a492bd6c966c424c0 to your computer and use it in GitHub Desktop.
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
#конвертим дату! | |
local_date: //span[has-class("post__time_published")] | |
#@replace("\n", "", "s"): $local_date/text() | |
@replace("^[ \n]+", "", "s"): $local_date/text() | |
@debug | |
#полная дата | |
@replace("^(.+) (\\w+)( \\d+)? в (\\S+).+", "$1 $2$3, $4", "s"): $local_date/text() | |
#относительные даты | |
@replace("^(\\w+) в (\\S+).+", "$1, $2", "s"): $local_date/text() | |
@replace("^сегодня", "today", "s"): $local_date/text() | |
@replace("^вчера", "yesterday", "s"): $local_date/text() | |
@datetime(3): $local_date | |
published_date: $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment