Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - MultiformeIngegno
496
Plugins / Re: Light URL Plugin Maybe?
« on April 21st, 2012, 12:23 AM »
STAR are you a karma guy or something similar..? :P
497
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 09:15 PM »
Quote from Arantor on April 20th, 2012, 08:57 PM
If you're talking about one a day or thereabouts, there's really no need to be fetching any more frequently than perhaps once every 12 hours, or if you're really bothered, 1 to 6 hours.
Uhm, I know but doing so I have to wait 12 hours to see the image on the website after I took it. Right..? I'd like to have max 10/15 min delay... do you think it's not possible?
Quote
I can't tell you whether using your account vs tags would be better. Which better describes what you want to show?
I asked that because I have 2 sites where I'm using this snippet. The first retrieves the images of my user_id stream only, the other retrieves photos with a certain tag (so it has to scan every photo to ensure they have or not my tag, I presume). So I was wondering if the user-stream only snippet is less intrusive for the server because it has to scan a stream only.
498
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 08:48 PM »
Quote from Arantor on April 20th, 2012, 08:42 PM
So you're fetching tags from Instagram... how often are items posted from Instagram that fit your tags?
Uhm.. not really 5 or 10 minutes..it's a unused tag (#bombacarta) and it's used only by our "organization".. I presume that there will be a new image every.. day? or every 2 days..?

What's a good timing..?

And what if I was extracting photos only from MY recent photos (only photos by the user_id xxx) instead of tags (i.e. there are no other images to "discard", every photo in the provided stream has to be shown)? Would this be better? :)
499
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 08:40 PM »
Do you think that 500 seconds (8 minutes) is a time too short and will impact on the server..?
I don't think it is.. also because the file cached is smaller than 10kb..
500
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 06:53 PM »
Is there a sense to have 60*60 instead of simply 3600? :o
501
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 06:40 PM »
Second solution worked. :)

To change the "caching time" to ~16 min instead of 1 hour I need to change this:
Code: [Select]
if(file_exists($cache) && filemtime($cache) > time() - 60*60)

to:
Code: [Select]
if(file_exists($cache) && filemtime($cache) > time() - 100*10)

..? 100*10 are seconds, right?
502
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 06:12 PM »
Ok, another problem.. :P
Instagram created_time timestamp is GMT (I presume.. :P).. I need to get the italian timezone..

So I changed this:
Code: [Select]
'.htmlentities(strftime('%e %B %Y alle %R', $value->caption->created_time)).'

to:
Code: [Select]
'.htmlentities(gmstrftime('%e %B %Y alle %R',time()+3600,$value->caption->created_time)).'

But I get:
Warning: gmstrftime() expects at most 2 parameters, 3 given
503
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:32 PM »
This code works, is it also correct? :)
'.htmlentities($value->caption->text, ENT_QUOTES, "UTF-8").'
504
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:20 PM »
Reasonable. :)

I "applied" htmlentities to my decoded data: '.htmlentities($value->caption->text).'
The downside is that accents are broken, example:  ì becomes Ã~

Page char-set is UTF-8. I thought it would have handled accented chars properly...!
505
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:52 AM »
Clear. :)

And about..:
Quote from MultiformeIngegno on April 20th, 2012, 02:14 AM
would it be faster (and better) to use file_get_contents or wp_remote_get (a WP function that uses the HTTP GET method..)?
506
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:48 AM »
Oh! Clear now. :)
Am I wrong or the line $date = $tweets['created_at']; is useless (because then I decode the date directly from the JSON)..? It confused me a bit... I thought I needed to change that too but then I realized I don't need that... Right?
507
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:34 AM »
Code: [Select]
<?php
setlocale(LC_TIME'it_IT');
$json wp_remote_get("http://twitter.com/status/user_timeline/lorenzoraffio.json?count=6"true);
$decode json_decode($json['body'], true);
echo "
<ul style='color:#6E6E6E'>"
;
$count count($decode); //counting the number of status
$date $tweets['created_at']; // created date
for($i=0;$i<$count;$i++){ echo '
<li>'
.$decode[$i]['text'].'<br><a href='; echo '"http://twitter.com/#!/'.$decode[0][user][name].'/status/'.$decode[$i][id].'"><small>'date('j F',strftime($decode[$i]['created_at'])) ."</small></a> - <a href='http://twitter.com/intent/tweet?in_reply_to=".$decode[$i][id]."'><small>rispondi</small></a> - <a href='http://twitter.com/intent/retweet?tweet_id=".$decode[$i][id]."'><small>retweet</small></a> - <a href='http://twitter.com/intent/favorite?tweet_id=".$decode[$i][id]."'><small>preferito</small></a></li>";} echo "
</ul>
"
;
?>


Warning: date() expects parameter 2 to be long :blush:
I'm doing it wrong.. right? :P
508
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:14 AM »
Uhm.. dates are still in english..
Code: [Select]
<?php
setlocale(LC_TIME'it_IT');
$json wp_remote_get("http://twitter.com/status/user_timeline/lorenzoraffio.json?count=6"true);
$decode json_decode($json['body'], true);
echo "
<ul style='color:#6E6E6E'>"
;
$count count($decode); //counting the number of status
$date $tweets['created_at']; // created date
for($i=0;$i<$count;$i++){ echo '
<li>'
.$decode[$i]['text'].'<br><a href='; echo '"http://twitter.com/#!/'.$decode[0][user][name].'/status/'.$decode[$i][id].'"><small>'date('j F',strtotime($decode[$i]['created_at'])) ."</small></a> - <a href='http://twitter.com/intent/tweet?in_reply_to=".$decode[$i][id]."'><small>rispondi</small></a> - <a href='http://twitter.com/intent/retweet?tweet_id=".$decode[$i][id]."'><small>retweet</small></a> - <a href='http://twitter.com/intent/favorite?tweet_id=".$decode[$i][id]."'><small>preferito</small></a></li>";} echo "
</ul>
"
;
?>


And another question.. would it be faster (and better) to use file_get_contents or wp_remote_get (a WP function that uses the HTTP GET method..)? :)
509
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:00 AM »
Quote from Nao on April 19th, 2012, 06:18 PM
How come I never heard about Amstamgram before they got gobbled up by Facebook? :P
Eh eh! I knew it already.. anyway this acquisition made it of course more and more famous. ;)

Okay.. now that I managed to get it working I.. have another question. :P
I'm using this code to create a list of tweets from my Twitter account:
Code: [Select]
<?php
$json wp_remote_get("http://twitter.com/status/user_timeline/lorenzoraffio.json?count=6"true);
$decode json_decode($json['body'], true);
echo "
<ul style='color:#6E6E6E'>"
;
$count count($decode); //counting the number of status
$date $tweets['created_at']; // created date
for($i=0;$i<$count;$i++){ echo '
<li>'
.$decode[$i]['text'].'<br><a href='; echo '"http://twitter.com/#!/'.$decode[0][user][name].'/status/'.$decode[$i][id].'"><small>'date('j F',strtotime($decode[$i]['created_at'])) ."</small></a> - <a href='http://twitter.com/intent/tweet?in_reply_to=".$decode[$i][id]."'><small>rispondi</small></a> - <a href='http://twitter.com/intent/retweet?tweet_id=".$decode[$i][id]."'><small>retweet</small></a> - <a href='http://twitter.com/intent/favorite?tweet_id=".$decode[$i][id]."'><small>preferito</small></a></li>";} echo "
</ul>
"
;
?>


Everything works perfectly except that the dates are in english. I need to set italian language for the strtotime function.. I know I need to use setlocale(LC_TIME, 'it_IT'); but I don't know where to add it..
510
Features / Re: "Select" code on iPhone
« on April 19th, 2012, 09:35 PM »
Nope. :D
Neither with default nor wireless theme