2064 posts
  • Has collected 50+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in 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
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
ThemeBlvd says
indiapart said
+1. Am I allowed to adapt this idea and try out? ;)

Yeah, totally of course. :-)

42 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+2 more
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
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
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
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
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
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Located in Canada
  • Has collected more than 1000 items on Envato Market
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
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
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
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Located in Canada
  • Has collected more than 1000 items on Envato Market
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
  • Has been part of the Envato Community for over 4 years
  • Located in Canada
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
jasonh1234 says

Simple. WEBFONTLOAD.COM

41 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Sells items exclusively on Envato Market
  • Has referred 50+ members
+2 more
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