2052 posts
  • Has been a member for 4-5 years
  • Bought between 50 and 99 items
  • Exclusive Author
  • United States
Landonw says
indiapart said
LandonWilson said
indiapart said
LandonWilson said
1) If you’re selling THAT MUCH , it’s no big deal for you to buy a better server. 2) Why don’t you just have an “UPDATE FONTS ” button in the admin panel?
Hi, You didn’t understand anything.

Yes I did. You were complaining about the mass server load, so all you need to do is update a file with the fonts and when they click update fonts it will download said text file to their server.

Alternatively, wp_cron.

Ah, okay, I see. Then, Your solution about the update button is still about the first point – I thought You meant You (the buyer) press “Update Fonts” and they magically appear, as You posted this for the second point. Also, regarding point no. 1 I explicitly said “hypothetical, not practical”. So this was not to tell everyone how “MUCH” I sell but it was a thought to prevent future issues, and not just the ones right now.

BroOf said
Here is a list of the Google Fonts: https://googlefontdirectory.googlecode.com/hg/

THIS – IS – GREAT !! Why just didn’t tell me anyone about this? If this stays forever, I’m absolutely happy =) Thx ;)

Best regards, indiapart.

Just make sure to set it up on something like a 1 week cron, make sure it doesn’t run all the time or else Google may ban your server.

1028 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 500 and 999 users
+1 more
ThemeBlvd says
indiapart said
+1. Am I allowed to adapt this idea and try out? ;)

Yeah, totally of course. :-)

42 posts
  • Europe
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
  • Exclusive Author
  • Has been a member for 3-4 years
indiapart says
BroOf said
Here is a list of the Google Fonts: https://googlefontdirectory.googlecode.com/hg/

Hmm, I just noticed the fonts are not named as they are called (no whitespaces). So I would have to scrape the folders, too :(

Best regards, indiapart.

25 posts
  • Elite Author
  • Germany
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 100 and 199 users
doitmax says

check this: https://github.com/kemayo/google-webfonts-lister

little python script returning an array with all available google webfonts from this list:

https://googlefontdirectory.googlecode.com/hg/

But the script needs really long time to be executed. So no solution for updating a theme periodically.

The array looks like this:

'Abel' => 'Abel', 'Aclonica' => 'Aclonica', 'Actor' => 'Actor', 'Allan' => 'Allan:bold', 'Allerta' => 'Allerta', 'Allerta Stencil' => 'Allerta+Stencil', 'Amaranth' => 'Amaranth:700,400,italic700,italic400'

Maybe you can run a cronjob once a week, store a file with the array on your server. After that let your themes check once a week if an updated version of the list is available and deliver the content to your theme customers. Would be a somewhat better solution.

11 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • New Zealand
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
webdesignpeople says
Until Google does the decent thing and exposes the font data via its API , this is the best solution: http://phat-reaction.com/googlefonts.php

cheers Anthony

701 posts
  • Bought between 1000 and 4999 items
  • Canada
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
chrismccoy says

here is a hacky way of doing it


$content = file_get_contents('https://googlefontdirectory.googlecode.com/hg/');

if(preg_match_all("/<li><a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a><\/li>/siU",$content, $matches, PREG_SET_ORDER)) 

foreach ($matches as $match) {
    echo str_replace(array('README','.hgignore','/'),'',$match[3]) . "\n";
}

?>
</li>
11 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • New Zealand
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
webdesignpeople says
chrismccoy said
here is a hacky way of doing it

$content = file_get_contents('https://googlefontdirectory.googlecode.com/hg/');

if(preg_match_all("/<li><a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a><\/li>/siU",$content, $matches, PREG_SET_ORDER)) 

foreach ($matches as $match) {
    echo str_replace(array('README','.hgignore','/'),'',$match[3]) . "\n";
}

?>
</li>

The good thing about the phat-reaction.com approach is it handles all the parsing and presents you with a serialised array in PHP . You can also grab it as JSON or XML .

Whatever approach you take, remember to cache it!

701 posts
  • Bought between 1000 and 4999 items
  • Canada
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
chrismccoy says
webdesignpeople said
chrismccoy said
here is a hacky way of doing it

$content = file_get_contents('https://googlefontdirectory.googlecode.com/hg/');

if(preg_match_all("/<li><a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a><\/li>/siU",$content, $matches, PREG_SET_ORDER)) 

foreach ($matches as $match) {
    echo str_replace(array('README','.hgignore','/'),'',$match[3]) . "\n";
}

?>
</li>

The good thing about the phat-reaction.com approach is it handles all the parsing and presents you with a serialised array in PHP . You can also grab it as JSON or XML .

Whatever approach you take, remember to cache it!

wish phat reaction showed the source code ;)

1 post
  • Bought between 10 and 49 items
  • Canada
  • Exclusive Author
  • Has been a member for 4-5 years
jasonh1234 says

Simple. WEBFONTLOAD.COM

41 posts
  • Elite Author
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Has been a member for 2-3 years
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
IshYoBoy says

Hi what we recommend is:

1. Create an internal script on your server which connects to the GoogleFont Library through your API and loads the fonts (e.g. via cron once per week) and cache these results on your server to avoid the API calls limit.

2. Create a script which can be called from your themes which will return the Cached results and the theme will be able to handle and use the output.

3. In order to avoid overload of your server, make sure the theme connects to your server just from time to time and it caches the output. Use the Transients API for that http://codex.wordpress.org/Transients_API

I guess this is it ;)

Cheers,
VlooMan

by
by
by
by
by
by