[Klug-general] Bash / Curl Tuition - Answers to Nathan's questions 16:32pm 15/04/2011

Nathan Friend nathan.friend at gmail.com
Sun Apr 17 15:24:51 UTC 2011


As a starter for 1.2

mysql -uUsername -pPassword
USE YourDatabaseName;
SELECT * FROM wp_comments WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <=
comment_date;

This will give you all comments in the last 24 hours.  If you only
want specific fields you can replace the * with comma separated field
names.

SELECT comment_author_email,comment_author_ip,comment_date FROM
wp_comments WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= comment_date;

Let me know how you get on.

Cheers,

Nathan.

On Fri, Apr 15, 2011 at 4:34 PM, Stephen Ryan <intrench at googlemail.com> wrote:
> 1.1 - This is also an exercise in learning to code everyday, so i have to
> write the scripts myself vs. using premade apps.
>
> 1.2  My website is wordpress, so i guess, like you say i will have to work
> out what commands to query WP db.
>
> 1.3  Again, i am interested in writing script to pull data of all kinds so
> for me stats analysis will be an excercise in scoping how the data is laid
> out in the stats app (whatever that may be) and then writing a script that
> scrapes the data and saves it to file which i can vi it.
>
> I want to be able to write code that uses Curl to crawl and identify
> metadata and scrape the tags for inspection. So say i want to use SEO on my
> website, i can run the script and it will tell me where the holes are in my
> SEO.
>
> Hope thats a bit clearer.
>
> Cheers
>
> Stephen
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent
>



More information about the Kent mailing list